I recommend starting with our getting started guide. It provides some background on locating API endpoints, performing basic queries, and Socrata datatypes.
I'll be hanging out online in several locations if you need help:
- IRC: #socrata-soda on Freenode
- @chrismetcalf or @socrata on Twitter
- You can also email [email protected] as well to create a support ticket
If you're at Govathon, Code Across NYC, or the Seattle Open Data Day event, you can also locate a Socrata helper in person.
- Accessed using RESTful paradigms
- Use standard HTTP verbs (
GET
,POST
,PUT
,DELETE
)
Format:
/resource/[4-4].ext
Example: Alameda County Restaurant Inspections
https://data.acgov.org/Government/Alameda-County-Restaurants-Inspections/3d5b-2rnz
... becomes ...
https://data.acgov.org/resource/3d5b-2rnz.json
Equality queries (resource_code == "G"
) are just GET
parameters:
GET https://data.acgov.org/resource/3d5b-2rnz.json?resource_code=G
More complex queries can be performed using SoQL, our query language:
GET https://data.acgov.org/resource/3d5b-2rnz.json?
$where=activity_date > '2012-11-01'
Tailor payload and retrieve XML:
GET https://data.acgov.org/resource/3d5b-2rnz.xml?
$where=activity_date > '2012-11-01'
&$select=activity_date,resource_code,violation_description
<response>
<row>
<row _id="20">
<activity_date>2012-11-06T00:00:00</activity_date>
<resource_code>G</resource_code>
<violation_description>...</violation_description>
</row>
...
Control how much output you get:
GET https://data.acgov.org/resource/3d5b-2rnz.json?
$limit=1
Page through data:
GET https://data.acgov.org/resource/3d5b-2rnz.json?
$limit=25
&$offset=50
Use the $jsonp
parameter to set your callback function name:
http://data.acgov.org/resource/k9se-aps6.json?city=Alameda&$jsonp=jsonp_callback_name
From jQuery:
$.ajax({
url: "http://data.acgov.org/resource/k9se-aps6.json?city=Alameda",
jsonp: "$jsonp",
dataType: "jsonp"
})
...