I've been trying to run googleplaces to return latitude/longitude for some facilities I am analyzing. I have 190 observations. I keep on trying to run the code but I get an error--seen by others-- as seen below. I can only get through 5 observations now before this error. I tried to increase obs to 2000 without any help. My API's fresh (from today) so I don't think I've run into Google's limit.




Code:
  googleplaces facilityname city state, results(3) textsearch apikey(__apikey_)
Searching google for 1 of 2000 requested searches
Searching google for 2 of 2000 requested searches
Searching google for 3 of 2000 requested searches
Return code was not OK
Searching google for 4 of 2000 requested searches
Searching google for 5 of 2000 requested searches
observation numbers out of range
r(198);
To try to figure out what's going on, I tried to trace the error. I'll save you the entire printout (unless you need it) and fastforward to the error:
Code:
set trace on
// //


-------------------------------------------------------------------------------------- end insheetjson ---
- replace g_lat = g_lat[`status'] in `i'
= replace g_lat = g_lat[2001] in 5
- replace g_lng = g_lng[`status'] in `i'
= replace g_lng = g_lng[2001] in 5
- local finaln = _N
- replace g_queryID = "`i'" in `status'/`finaln'
= replace g_queryID = "5" in 2001/2000
observation numbers out of range
I tried to look in the ado file (http://fmwww.bc.edu/RePEc/bocode/g/googleplaces.ado) and this is what I saw. It seems that the program is trying to constantly insert more observations than I have:
Code:
*Here is the main search method, and modifications to what information is pulled need to happen within the forval command
forval i = `in' {
local srch = `csearch'[`i']
local offset = _N
local status = `offset'+1
//
//

*  Create some needed variables to fill in the g_queryID variable and to do the instant debug notifier
local finaln = _N
*  Fill in the queryID number for all results pulled by the search
replace g_queryID = "`i'" in `status'/`finaln'
// //
Is this a bug? Is this fixable by directly editing the ado file and running it on my own?

Here's others commenting on the same bug in the past: https://www.statalist.org/forums/for...api-s-in-stata