> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…
I also found this odd, but I can think of two reasons, 1. CSV is not a single well-defined format. Some people use rfc4180, but not everybody does. 2. JSON is easier to parse than CSV for JavaScript clients, i.e., browsers. On the other hand, JSON is not a subset of JavaScript.
The US Census now has an API
11–20 of 42 posts
Re: The US Census now has an API
#12> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…
It's very simple to transform that kind of data into $your_preferred_structure. It's also a very agnostic format.
Re: The US Census now has an API
#13> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…
1) Whether it's user-friendly or not, it's still JSON, which makes JSON-P possible (they support JSON-P).
2) It probably mirrors the way they store their data (in tables, whether SQL or Access or Excel, doesn't really matter).
3) It's more compact than traditional JSON, which means less bandwidth, which means less cost. Keep in mind that this is essentially a not-for-profit API from a not-for-profit organization with the worst possible budgeting scenario. Yes, Gzip would basically eliminate this benefit, but they don't have gzip enabled and enabling it may be difficult or impossible under whatever constraints they operate under.
Also, it's entirely possible that this API has existed privately for a long, long time in a CSV format, and they simply made a minor enhancement to make it JSON and JSON-P compatible and open up the endpoints to the public.
Re: The US Census now has an API
#14> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…
This doesn't seem unreasonable. 1) Whether it's user-friendly or not, it's still JSON, which makes JSON-P possible (they support JSON-P). 2) It probably mirrors the way they store their data (in tables, whether SQL or Access or Excel, doesn't really matter). 3) It's more compact than traditional JSON, which means less bandwidth, which means less cost. Keep in mind that this is essentially a not-for-profit API from a…
Re: The US Census now has an API
#15Also, for further reading on the topic of .gov APIs, http://ben.balter.com/2012/06/02/publishing-government-data-... is a great start.
Re: The US Census now has an API
#16> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…
This doesn't seem unreasonable. 1) Whether it's user-friendly or not, it's still JSON, which makes JSON-P possible (they support JSON-P). 2) It probably mirrors the way they store their data (in tables, whether SQL or Access or Excel, doesn't really matter). 3) It's more compact than traditional JSON, which means less bandwidth, which means less cost. Keep in mind that this is essentially a not-for-profit API from a…
{
P0010001 : [
'710231',
'4779736',
// ... etc.
],
NAME : [
'Alaska',
'Alabama',
// ... etc.
],
state: [
'02',
'01,
// ... etc.
],
// ... etc.
}Re: The US Census now has an API
#17Re: The US Census now has an API
#18Wouldn't this be better served by a downloadable SQLite file rather than a web service?
If there's any problem with their downloadable data offerings, it's that they have so many of them that it can be difficult to figure out exactly which one has the data you're looking for.
Re: The US Census now has an API
#19Wouldn't this be better served by a downloadable SQLite file rather than a web service?
this data is already available as a downloadable file. Check out ftp://ftp.census.gov/ It's CSV, and it's kinda ugly-looking, but it's available.
The 'full' data set is ...rather huge. The full data set for any particular report is rather huge.
The advantage of this API, I expect, is it allows people to make quick, machine readable queries for useful subsets of the data. If you want a JavaScript mashup that tells you the number of people who live on your block, use this. If you want to know the population of every block everywhere for data-crunching purposes, just download the CSV.
Re: The US Census now has an API
#20> The response for all queries is formatted as a two dimensional JSON array where the first row provides column names and subsequent rows provide data values. Hmmm... looking at the example of this I can't help but think there has got to be a better way. This is more just a standard CSV (first row is header, all other rows are data). Using JSON for data formatted as such is kind of a waste of JSON. If you pass that e…