BEA API: a missing UserID returns HTTP 200 with a zero-length body

Checked 2026-09-08 · Statistical agencies: BLS, Census, BEA, FRED and EIA

apps.bea.gov/api/data answers a request with no UserID with HTTP 200, content-type text/plain and content-length 0. There is no error object to read; a JSON parser fails on empty input. Send a UserID that is not registered and you get HTTP 200 again, this time with a JSON body whose error is buried at BEAAPI.Results.Error. BEA does not use status codes to signal failure at all.

What we saw

No UserID gives 200 and an empty body. Source (response headers, 2026-09-08).

HTTP/2 200 
content-type: text/plain; charset=utf-8
content-length: 0

The downloaded body is zero bytes on disk, not whitespace. Source (byte count of saved response, 2026-09-08).

0 /tmp/bea0.out

An unregistered UserID gives 200 with the error nested three levels deep, and echoes every parameter back. Source (BEAAPI.Results.Error, 2026-09-08).

{"BEAAPI":{"Request":{"RequestParam":[{"ParameterName":"USERID","ParameterValue":"00000000-0000-0000-0000-000000000000"},{"ParameterName":"METHOD","ParameterValue":"GETDATASETLIST"},{"ParameterName":"RESULTFORMAT","ParameterValue":"JSON"}]},"Results":{"Error":{"APIErrorCode":"1","APIErrorDescription":"Invalid Request - Invalid API UserId."}}}}
HTTP 200

The UserID check runs before the method check: drop method entirely and you still get the UserId error, not a missing-method error. Source (BEAAPI.Results.Error.APIErrorDescription, 2026-09-08).

{"BEAAPI":{"Request":{"RequestParam":[{"ParameterName":"USERID","ParameterValue":"00000000-0000-0000-0000-000000000000"},{"ParameterName":"RESULTFORMAT","ParameterValue":"JSON"}]},"Results":{"Error":{"APIErrorCode":"1","APIErrorDescription":"Invalid Request - Invalid API UserId."}}}}

Parameter names are echoed upper-cased regardless of the case you sent, so matching the echo against your request needs a case fold. Source (BEAAPI.Request.RequestParam[].ParameterName, 2026-09-08).

"ParameterName":"USERID" ... "ParameterName":"METHOD" ... "ParameterName":"RESULTFORMAT"

The command

curl -sS -D - -o /tmp/bea0.out 'https://apps.bea.gov/api/data?method=GETDATASETLIST&ResultFormat=json' | grep -iE 'HTTP/|content-type|content-length'; wc -c /tmp/bea0.out
HTTP/2 200 
content-type: text/plain; charset=utf-8
content-length: 0
0 /tmp/bea0.out

Checked 2026-09-08.

curl -sS -w '\nHTTP %{http_code}\n' 'https://apps.bea.gov/api/data?UserID=00000000-0000-0000-0000-000000000000&method=GETDATASETLIST&ResultFormat=json'
{"BEAAPI":{"Request":{"RequestParam":[{"ParameterName":"USERID","ParameterValue":"00000000-0000-0000-0000-000000000000"},{"ParameterName":"METHOD","ParameterValue":"GETDATASETLIST"},{"ParameterName":"RESULTFORMAT","ParameterValue":"JSON"}]},"Results":{"Error":{"APIErrorCode":"1","APIErrorDescription":"Invalid Request - Invalid API UserId."}}}}
HTTP 200

Checked 2026-09-08.

curl -sS 'https://apps.bea.gov/api/data?UserID=00000000-0000-0000-0000-000000000000&ResultFormat=json'
{"BEAAPI":{"Request":{"RequestParam":[{"ParameterName":"USERID","ParameterValue":"00000000-0000-0000-0000-000000000000"},{"ParameterName":"RESULTFORMAT","ParameterValue":"JSON"}]},"Results":{"Error":{"APIErrorCode":"1","APIErrorDescription":"Invalid Request - Invalid API UserId."}}}}

Checked 2026-09-08.

requestHTTPcontent-typebodywhere the error is
no UserID200text/plain; charset=utf-80 bytesnowhere - infer it from the empty body
UserID present but unregistered200(JSON)BEAAPI envelopeBEAAPI.Results.Error.APIErrorCode = 1
UserID unregistered, no method200(JSON)BEAAPI envelopesame UserId error - UserID is checked first

Limits

Open question

Is the zero-length response specific to a missing UserID, or does any request BEA cannot parse at all return 200 and nothing? A malformed method name would separate the two.

Plain text