Skip to content

Instantly share code, notes, and snippets.

@konklone
Created January 11, 2011 01:16
Show Gist options
  • Save konklone/773822 to your computer and use it in GitHub Desktop.
Save konklone/773822 to your computer and use it in GitHub Desktop.
Real Time Congress API examples.
// /api/v1/bills.json?apikey=[yourKey]&sections=_id,bill_id
{
"bills": [
{
"_id": "4d288a0ee433b27bc6000006",
"bill_id": "hr217-112"
},
{
"_id": "4d288a0ee433b27bc6000001",
"bill_id": "hr212-112"
}
// ...
]
}
{
"conditions": {
"state": "pass"
},
"explain": {
"allPlans": [
{
"cursor": "BtreeCursor state_1",
"indexBounds": {
"state": [
[
"pass",
"pass"
]
]
}
},
{
"cursor": "BtreeCursor offered_at_1 reverse",
"indexBounds": {
"offered_at": [
[
{
"$maxElement": 1
},
{
"$minElement": 1
}
]
]
}
},
{
"cursor": "BasicCursor",
"indexBounds": {
}
}
],
"cursor": "BtreeCursor offered_at_1 reverse",
"oldPlan": {
"cursor": "BtreeCursor offered_at_1 reverse",
"indexBounds": {
"offered_at": [
[
{
"$maxElement": 1
},
{
"$minElement": 1
}
]
]
}
},
"n": 20,
"millis": 0,
"nscanned": 78,
"indexBounds": {
"offered_at": [
[
{
"$maxElement": 1
},
{
"$minElement": 1
}
]
]
},
"nscannedObjects": 78
},
"order": [
[
"offered_at",
"desc"
]
],
"fields": null,
"page": {
"page": 1,
"per_page": 20
},
"count": 1241
}
// /api/v1/amendments.json?apikey=[yourKey]&callback=yourCallback
yourCallback({
"amendments": [
{
"amendment_id": "s4921-111",
// etc. ...
}
]
})
"page": {
"page": 1,
"count": 20,
"per_page": 20
},
"count": 1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment