Stata error with ACS API

Hi all,

I'm having intermittent trouble using the Census ACS API in Stata 15.0. For a brief period, the API calls were working fine in my office. Now they've stopped working, and when I make the following API call I get the following error message:

gen str60 B01001_001E = ""

gen str60 geoname = ""

gen str60 state = ""

insheetjson B01001_001E geoname state using "api.census.gov/.../acs1, aoa(1) columns( "1" "2" "3" "4")

Received fatal alert: handshake_failure
Error -603, Unable to open URL: file could not be opened
Warning: No response from source?!?

* Notes: I've left the API key empty above but am using my personal key in practice. This requires insheetjson.ado and libjson.mlib to be installed. 

I can't tell if it's a Stata issue, firewall issue, or Census server issue. When I past the API directly into a Chrome browser window it works fine, so I suspect it's one of the first two or a combination of the first two.

I've had trouble just copying files from the Census FTP server within Stata as well. For example, this simple command fails in similar fashion.

copy "" "mar98supp.zip"

Received fatal alert: handshake_failure
r(5100)

 

Has anyone else experienced this issue with Stata 15.0, or any recent version for that matter? Or has anyone noticed a change in behavior recently?

Many thanks,

Vincent

Parents
  • Works fine on my system.
    That's on Stata 15.1 on Win10
    I used the key from your second code block, btw, so that's not causing the trouble.

    Edit: also works if I include a line 'version 14.2' prior to this code, although I'm not 100% sure that would always recreate the issue.

    Code:

    . cap prog drop apicheck

    . program apicheck
      1.     tempfile webfile
      2.     copy "">api.census.gov/.../sf1 "webfile.txt"
      3.     import delimited "webfile.txt", clear
      4. end

    . apicheck
    (5 vars, 238 obs)

    .
    end of do-file

    . edit

    .

Reply
  • Works fine on my system.
    That's on Stata 15.1 on Win10
    I used the key from your second code block, btw, so that's not causing the trouble.

    Edit: also works if I include a line 'version 14.2' prior to this code, although I'm not 100% sure that would always recreate the issue.

    Code:

    . cap prog drop apicheck

    . program apicheck
      1.     tempfile webfile
      2.     copy "">api.census.gov/.../sf1 "webfile.txt"
      3.     import delimited "webfile.txt", clear
      4. end

    . apicheck
    (5 vars, 238 obs)

    .
    end of do-file

    . edit

    .

Children
No Data