I am trying to get some data from the API of American Community Survey by using insheetjson. But when I run the following codes, I got the error message "Invalid column name/selector 'CBSA'. (Possible name candidates are: )"
I thought it might be that the column names of the first row from the web server were not "CBSA", "NAME", and "metropolitan statistical area/micropolitan statistical area". Thus, I used the following command to check the data
But it show that the column names were correct, please see below
Does anyone know why this happened?
Code:
gen str10 CBSA_temp = "" gen str200 Area = "" gen str10 temp = "" insheetjson CBSA_temp Area temp using "https://api.census.gov/data/2017/acs/acs1/profile?get=CBSA,NAME&for=metropolitan%20statistical%20area/micropolitan%20statistical%20area:*", aoa(1) columns("CBSA" "NAME" "metropolitan statistical area/micropolitan statistical area")
Code:
insheetjson CBSA_temp Area temp using "https://api.census.gov/data/2017/acs/acs1/profile?get=CBSA,NAME&for=metropolitan%20statistical%20area/micropolitan%20statistical%20area:*", showresponse
Code:
Response from server: [ [ "CBSA", "NAME", "metropolitan statistical area/micropolitan statistical area" ], [ "10140", "Aberdeen, WA Micro Area", "10140" ], [ "10180", "Abilene, TX Metro Area", "10180" ], ......
Comment