Skip to content

Data · API reference · version 1.0.0

API reference

Every endpoint of the data API

endpoints
14
objects
10

Statements

What politicians say: posts on X, press releases, newsletters and floor speeches, each with the labels the classifier gave it.

GET /v1/statements

Classified statements: tweets, press releases, newsletters, floor speeches (members of Congress, state legislators, governors). Tweets carry tweet_id and an empty text.

Returns up to limit items and a next_cursor; send it back as cursor, with the same other parameters, until it is null. A page that comes back full can be followed by an empty last page. Unknown parameters are refused (400).

Parameters

Parameters of GET /v1/statements
NameInTypeRequiredDefaultDescription
qquerystring, up to 512 charactersnoWords; "a phrase", -not, a | b, prefix*
sortquerystringOne of: relevance, date_desc, date_ascnoOrder. Default: relevance with q, otherwise date_desc.
limitqueryinteger, 1–100no25Items per page.
cursorquerystringnonext_cursor from the previous page
partyqueryarray of stringOne of: D, R, I, OnoOne or more values, comma-separated or repeated.
statequeryarray of stringnoTwo-letter state codes, e.g. PA. One or more values, comma-separated or repeated.
chamberqueryarray of stringOne of: house, senate, lower, upper, legislature, governornoOne or more values, comma-separated or repeated.
levelqueryarray of stringOne of: federal, state, governornoOne or more values, comma-separated or repeated.
sourcequeryarray of stringOne of: tweets, tweets_state, tweets_governors, statements, statements_governors, newsletters, floor, state_floornoOne or more values, comma-separated or repeated.
categoryqueryarray of stringOne of: attack_personal, attack_policy, policy, bipartisanship, creditclaimingnoKinds of statement. One or more values, comma-separated or repeated.
policy_areaqueryarray of stringnoPolicy areas, written as the data write them. One or more values; repeat the parameter (values may contain commas).
extremequerystringOne of: yes, nonoyes: only statements with an extreme label; no: only those without. yes or no (true/false and 1/0 also work).
date_fromquerystring (date)noFrom this date (YYYY-MM-DD).
date_toquerystring (date)noUp to this date (YYYY-MM-DD).
personqueryarray of stringnoOfficial ids: what they said. One or more values, comma-separated or repeated.
currentquerystringOne of: yes, nonoyes or no (true/false and 1/0 also work).
yearquerystringnoCalendar year(s), e.g. 2025.

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/statements"

Response 200OK

Fields of the 200 response of GET /v1/statements
FieldTypeDescription
dataarray of StatementThis page.
data[].idstringStatement id: <source>:<source id>.
data[].sourcestringOne of: tweets, tweets_state, tweets_governors, statements, statements_governors, newsletters, floor, state_floorWhere it comes from. tweets, tweets_state and tweets_governors are posts on X.
data[].datestring (date)Date.
data[].textstringThe whole text. Empty for posts on X: use tweet_id.
data[].urlstring or nullThe original.
data[].categoriesarray of stringOne of: attack_personal, attack_policy, policy, bipartisanship, creditclaimingKinds of statement the classifier found; a statement can have several or none.
data[].policy_areasarray of stringPolicy areas it discusses (of 25).
data[].extremeobject or nullSet when it uses an extreme label: the label and its target.
data[].extreme.labelstringThe label(s) used.
data[].extreme.targetstring or nullWho or what it describes.
data[].attackobject or nullSet when it is a personal attack: the trait attacked and the target.
data[].attack.typestring or nullThe trait(s) attacked.
data[].attack.targetstring or nullThe person attacked.
data[].personOfficialWho said it.
data[].titlestring or nullPress release or newsletter subject; null for posts and floor speeches.
data[].truncatedbooleanAlways false here: the API returns whole texts.
data[].tweet_idstring or nullThe post's id on X (posts on X only).
next_cursorstring or nullSend it back as cursor for the next page; null on the last page.
totalinteger or nullNumber of matches.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/statements
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

GET /v1/statements/{id}

One statement

Parameters

Parameters of GET /v1/statements/{id}
NameInTypeRequiredDefaultDescription
idpathstringyesStatement id (the id field of a statement).

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/statements/$ID"

Set $ID first, and $PULSE_KEY to your key.

Response 200OK

Fields of the 200 response of GET /v1/statements/{id}
FieldTypeDescription
dataStatementA classified statement.
data.idstringStatement id: <source>:<source id>.
data.sourcestringOne of: tweets, tweets_state, tweets_governors, statements, statements_governors, newsletters, floor, state_floorWhere it comes from. tweets, tweets_state and tweets_governors are posts on X.
data.datestring (date)Date.
data.textstringThe whole text. Empty for posts on X: use tweet_id.
data.urlstring or nullThe original.
data.categoriesarray of stringOne of: attack_personal, attack_policy, policy, bipartisanship, creditclaimingKinds of statement the classifier found; a statement can have several or none.
data.policy_areasarray of stringPolicy areas it discusses (of 25).
data.extremeobject or nullSet when it uses an extreme label: the label and its target.
data.extreme.labelstringThe label(s) used.
data.extreme.targetstring or nullWho or what it describes.
data.attackobject or nullSet when it is a personal attack: the trait attacked and the target.
data.attack.typestring or nullThe trait(s) attacked.
data.attack.targetstring or nullThe person attacked.
data.personOfficialWho said it.
data.titlestring or nullPress release or newsletter subject; null for posts and floor speeches.
data.truncatedbooleanAlways false here: the API returns whole texts.
data.tweet_idstring or nullThe post's id on X (posts on X only).
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/statements/{id}
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
404Not found
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

Officials

Members of Congress, state legislators and governors, with full profiles and roll-call records.

GET /v1/officials

Officials: members of Congress, state legislators, governors.

Returns up to limit items and a next_cursor; send it back as cursor, with the same other parameters, until it is null. A page that comes back full can be followed by an empty last page. Unknown parameters are refused (400).

Parameters

Parameters of GET /v1/officials
NameInTypeRequiredDefaultDescription
qquerystring, up to 512 charactersnoWords; "a phrase", -not, a | b, prefix*
sortquerystringOne of: relevance, name, csip_asc, csip_desc, statements_desc, extreme_descnoOrder. Default: relevance with q, otherwise name.
limitqueryinteger, 1–100no25Items per page.
cursorquerystringnonext_cursor from the previous page
partyqueryarray of stringOne of: D, R, I, OnoOne or more values, comma-separated or repeated.
statequeryarray of stringnoTwo-letter state codes, e.g. PA. One or more values, comma-separated or repeated.
chamberqueryarray of stringOne of: house, senate, lower, upper, legislature, governornoOne or more values, comma-separated or repeated.
levelqueryarray of stringOne of: federal, state, governornoOne or more values, comma-separated or repeated.
csip_minquerynumbernoIdeology (CSIP) score. At least this number.
csip_maxquerynumbernoIdeology (CSIP) score. At most this number.

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/officials"

Response 200OK

Fields of the 200 response of GET /v1/officials
FieldTypeDescription
dataarray of OfficialThis page.
data[].idstringOfficial id: the bioguide id (Congress), the Open States id without ocd-person/ (state legislators) or gov-<slug> (governors). Use it with /v1/officials/{id}.
data[].levelstringOne of: federal, state, governorLevel of government.
data[].namestringName.
data[].partystringOne of: D, R, I, OParty; O is any other, or none.
data[].statestringState, as a two-letter code.
data[].chamberstringOne of: house, senate, lower, upper, legislature, governorChamber or office.
data[].districtstring or nullDistrict, where the seat has one.
data[].photostring or nullPhoto: a site-relative or full URL.
data[].csipnumber or nullIdeology (CSIP) from the latest validated run. 0 is the centre of the scale; negative is more liberal, positive more conservative.
data[].statementsintegerStatements in the current window.
data[].extremeRatenumber or nullShare of statements with an extreme label, current window (0 to 1).
next_cursorstring or nullSend it back as cursor for the next page; null on the last page.
totalinteger or nullNumber of matches.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/officials
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

GET /v1/officials/{id}

An official's full profile (rhetoric, policy, ideology, money, votes, legislation)

Tweet text is removed everywhere in the profile, as in every response.

Parameters

Parameters of GET /v1/officials/{id}
NameInTypeRequiredDefaultDescription
idpathstringyesOfficial id (the id field of an official).

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/officials/$ID"

Set $ID first, and $PULSE_KEY to your key.

Response 200OK

Fields of the 200 response of GET /v1/officials/{id}
FieldTypeDescription
dataobjectThe profile, as the site's profile page uses it.
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/officials/{id}
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
404Not found
429Over the per-minute or per-day limit (with Retry-After)

GET /v1/officials/{id}/votes

An official's roll-call votes, newest first

One page is one stored part of the record; follow next_cursor to the end. Records are written for term windows (current and term:<id>) only, so 12m and all find nothing (404).

Parameters

Parameters of GET /v1/officials/{id}/votes
NameInTypeRequiredDefaultDescription
idpathstringyesOfficial id.
windowquerystringnocurrentcurrent, 12m, all or term:<id>
cursorquerystringnonext_cursor from the previous page

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/officials/$ID/votes"

Set $ID first, and $PULSE_KEY to your key.

Response 200OK

Fields of the 200 response of GET /v1/officials/{id}/votes
FieldTypeDescription
dataarray of OfficialVoteThis page.
data[].vote_idstringRoll-call id; federal ids are us-<congress>-<h|s>-<roll>.
data[].datestring (date)Date of the vote.
data[].chamberstringOne of: house, senate, lower, upper, legislature, governorChamber.
data[].billstring or nullThe bill voted on, if any.
data[].bill_titlestring or nullIts title.
data[].questionstringThe question put to the vote.
data[].resultstringThe result, as recorded.
data[].marginnumber or nullMargin of the result (smaller is closer).
data[].party_splitobjectYeas and nays by party (D, R, I, O).
data[].party_split.<key>.yeaintegerYeas.
data[].party_split.<key>.nayintegerNays.
data[].key_reasonsarray of stringOne of: law, close, crossover, salientWhy it is a key vote: law (became law), close (decided by under 10%), crossover (at least 10% of a party voted against its majority), salient (one of the 25 bills officials mention most).
data[].urlstring or nullThe roll call at its source.
data[].positionstringOne of: yea, nay, present, not_votingHow the official voted.
data[].with_partyboolean or nullWhether the vote was with the majority of the official's party.
next_cursorstring or nullSend it back as cursor for the next page; null on the last page.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/officials/{id}/votes
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
404Not found
429Over the per-minute or per-day limit (with Retry-After)

Bills

Federal and state bills, and the same proposal in other states.

GET /v1/bills

Federal and state bills with sponsors, stage and policy area.

Returns up to limit items and a next_cursor; send it back as cursor, with the same other parameters, until it is null. A page that comes back full can be followed by an empty last page. Unknown parameters are refused (400).

Parameters

Parameters of GET /v1/bills
NameInTypeRequiredDefaultDescription
qquerystring, up to 512 charactersnoWords; "a phrase", -not, a | b, prefix*
sortquerystringOne of: relevance, date_desc, date_asc, latest_descnoOrder. Default: relevance with q, otherwise date_desc.
limitqueryinteger, 1–100no25Items per page.
cursorquerystringnonext_cursor from the previous page
jurisdictionqueryarray of stringnoUS for Congress, or two-letter state codes. One or more values, comma-separated or repeated.
sessionqueryarray of stringnoOne or more values, comma-separated or repeated.
policy_areaqueryarray of stringnoPolicy areas, written as the data write them. One or more values; repeat the parameter (values may contain commas).
statusqueryarray of stringOne of: introduced, committee, passed_one, passed_both, lawnoOne or more values, comma-separated or repeated.
sponsorqueryarray of stringnoOfficial id: bills they sponsored or cosponsored.
date_fromquerystring (date)noFrom this date (YYYY-MM-DD).
date_toquerystring (date)noUp to this date (YYYY-MM-DD).

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/bills"

Response 200OK

Fields of the 200 response of GET /v1/bills
FieldTypeDescription
dataarray of BillThis page.
data[].bill_idstringBill id.
data[].jurisdictionstringUS for Congress, or a state's two-letter code.
data[].sessionstringSession.
data[].numberstringBill number.
data[].titlestringTitle.
data[].introducedstring (date) or nullDate introduced.
data[].statusstringOne of: introduced, committee, passed_one, passed_both, lawThe furthest stage reached.
data[].latest_actionstring or nullThe latest action.
data[].latest_action_datestring (date) or nullIts date.
data[].policy_areastring or nullPolicy area (of 25).
data[].policy_area_sourcestring or nullOne of: crs, llmcrs when the Congressional Research Service assigned the area, llm when a language model did.
data[].policy_area_crsstring or nullFederal only: the CRS policy area (of 33) before it is mapped to the 25.
data[].urlstring or nullThe bill at its source.
data[].sponsorsarray of OfficialSponsors.
data[].n_cosponsorsintegerNumber of cosponsors.
next_cursorstring or nullSend it back as cursor for the next page; null on the last page.
totalinteger or nullNumber of matches.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/bills
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

GET /v1/bills/{bill_id}/similar

The same proposal in other states (similarity 0.87 or more)

Only state bills are compared; total is the number of similar bills.

Parameters

Parameters of GET /v1/bills/{bill_id}/similar
NameInTypeRequiredDefaultDescription
bill_idpathstringyesA state bill's id (the bill_id field of a bill).

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/bills/$BILL_ID/similar"

Set $BILL_ID first, and $PULSE_KEY to your key.

Response 200OK

Fields of the 200 response of GET /v1/bills/{bill_id}/similar
FieldTypeDescription
dataSimilarBills
data.billobjectThe bill asked about.
data.bill.bill_idstringBill id.
data.bill.jurisdictionstringState, as a two-letter code.
data.bill.numberstringBill number.
data.bill.yearinteger or nullYear.
data.bill.titlestringTitle.
data.bill.became_lawbooleanWhether it became law.
data.thresholdnumberThe similarity a bill needs to count as the same.
data.similararray of objectThe same proposal in other states.
data.similar[].bill_idstringBill id.
data.similar[].jurisdictionstringState, as a two-letter code.
data.similar[].numberstringBill number.
data.similar[].yearinteger or nullYear.
data.similar[].titlestringTitle.
data.similar[].became_lawbooleanWhether it became law.
data.similar[].similaritynumberCosine similarity of the two texts.
next_cursorstring or nullAlways null.
totalinteger or nullNumber of items.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/bills/{bill_id}/similar
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
404Not found
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

Votes

Roll-call votes with party splits.

GET /v1/votes

Roll-call votes with party splits.

Returns up to limit items and a next_cursor; send it back as cursor, with the same other parameters, until it is null. A page that comes back full can be followed by an empty last page. Unknown parameters are refused (400).

Parameters

Parameters of GET /v1/votes
NameInTypeRequiredDefaultDescription
qquerystring, up to 512 charactersnoWords; "a phrase", -not, a | b, prefix*
sortquerystringOne of: relevance, date_desc, date_asc, margin_ascnoOrder. Default: relevance with q, otherwise date_desc.
limitqueryinteger, 1–100no25Items per page.
cursorquerystringnonext_cursor from the previous page
jurisdictionqueryarray of stringnoUS for Congress, or two-letter state codes. One or more values, comma-separated or repeated.
chamberqueryarray of stringOne of: house, senate, lower, upper, legislature, governornoOne or more values, comma-separated or repeated.
date_fromquerystring (date)noFrom this date (YYYY-MM-DD).
date_toquerystring (date)noUp to this date (YYYY-MM-DD).
keyquerystringOne of: yes, nonoyes: only key votes; no: only the others. yes or no (true/false and 1/0 also work).
billqueryarray of stringnoOne or more values, comma-separated or repeated.
floorquerystringOne of: yes, nonoyes or no (true/false and 1/0 also work).
resultqueryarray of stringnoOne or more values; repeat the parameter (values may contain commas).
yearquerystringnoCalendar year(s), e.g. 2025.

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/votes"

Response 200OK

Fields of the 200 response of GET /v1/votes
FieldTypeDescription
dataarray of VoteThis page.
data[].vote_idstringRoll-call id; federal ids are us-<congress>-<h|s>-<roll>.
data[].datestring (date)Date of the vote.
data[].chamberstringOne of: house, senate, lower, upper, legislature, governorChamber.
data[].billstring or nullThe bill voted on, if any.
data[].bill_titlestring or nullIts title.
data[].questionstringThe question put to the vote.
data[].resultstringThe result, as recorded.
data[].marginnumber or nullMargin of the result (smaller is closer).
data[].party_splitobjectYeas and nays by party (D, R, I, O).
data[].party_split.<key>.yeaintegerYeas.
data[].party_split.<key>.nayintegerNays.
data[].key_reasonsarray of stringOne of: law, close, crossover, salientWhy it is a key vote: law (became law), close (decided by under 10%), crossover (at least 10% of a party voted against its majority), salient (one of the 25 bills officials mention most).
data[].urlstring or nullThe roll call at its source.
data[].jurisdictionstringUS, or a state's two-letter code.
data[].yeainteger or nullYeas.
data[].nayinteger or nullNays.
data[].keybooleanWhether it is a key vote.
next_cursorstring or nullSend it back as cursor for the next page; null on the last page.
totalinteger or nullNumber of matches.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/votes
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

Surveys

Aggregates from the America's Political Pulse survey. Never individual responses.

GET /v1/surveys/state-estimates

State opinion estimates (MRP)

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/surveys/state-estimates"

Response 200OK

Fields of the 200 response of GET /v1/surveys/state-estimates
FieldTypeDescription
dataanyThe published file, as the site uses it.
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/surveys/state-estimates
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

GET /v1/surveys/toplines

Survey topline reports

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/surveys/toplines"

Response 200OK

Fields of the 200 response of GET /v1/surveys/toplines
FieldTypeDescription
dataanyThe published file, as the site uses it.
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/surveys/toplines
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

Political violence

Political violence events in the United States.

GET /v1/violence/events

Political violence events

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/violence/events"

Response 200OK

Fields of the 200 response of GET /v1/violence/events
FieldTypeDescription
dataanyThe published file, as the site uses it.
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/violence/events
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

Bulk files

Whole datasets, zipped CSV and Parquet.

GET /v1/bulk

Bulk files (CSV and Parquet zips)

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/bulk"

Response 200OK

Fields of the 200 response of GET /v1/bulk
FieldTypeDescription
dataarray of BulkFileEvery bulk file.
data[].namestringName, for /v1/bulk/{name}.
data[].descriptionstringWhat the file holds.
data[].rowsintegerRows.
data[].bytesintegerSize of the zip.
data[].formatsarray of stringFormats in the zip.
data[].downloadstringWhere to download it.
next_cursorstring or nullAlways null.
totalinteger or nullNumber of items.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/bulk
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)
503Not available right now (being built, or busy); try again later

GET /v1/bulk/{name}

Download a bulk file (302 to a five-minute link; counts toward the daily downloads)

Parameters

Parameters of GET /v1/bulk/{name}
NameInTypeRequiredDefaultDescription
namepathstringyesThe file's name, from /v1/bulk.

Example request

curl -L -OJ -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/bulk/$NAME"

Set $NAME first, and $PULSE_KEY to your key.

Response 302Redirect to the file

HeadersLocation A download link, valid for five minutes. · X-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/bulk/{name}
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
404Not found
429Over a rate limit (see Retry-After), or today's downloads are used up (they reset at midnight UTC)

Account

Your own limits and use.

GET /v1/usage

Your limits and use

Example request

curl -H "Authorization: Bearer $PULSE_KEY" \
  "https://api.americaspoliticalpulse.com/v1/usage"

Response 200OK

Fields of the 200 response of GET /v1/usage
FieldTypeDescription
dataUsage
data.limitsobjectYour account's limits.
data.limits.requests_per_minuteintegerPer minute.
data.limits.requests_per_dayintegerPer day (UTC).
data.limits.downloads_per_dayintegerBulk downloads per day (UTC).
data.todayobject
data.today.requestsintegerRequests today (UTC).
data.today.by_resourceobjectRequests today by resource (statements, officials, …).
data.daysarray of objectThe last 30 days with requests.
data.days[].datestringDay, as YYYYMMDD (UTC).
data.days[].requestsintegerRequests that day.
next_cursorstring or nullAlways null.
totalinteger or nullAlways null.
metaMetaLicence, citation and sources, on every response.

HeadersX-RateLimit-Limit-Minute Your limit this minute. · X-RateLimit-Remaining-Minute Requests left this minute. · X-RateLimit-Limit-Day Your limit this day. · X-RateLimit-Remaining-Day Requests left this day.

Errors

Each comes as Error: {"error": "…"}.

Errors of GET /v1/usage
StatusWhen
400A parameter is wrong (the message says which), or the key was sent in the URL
401No key, or a key that is not valid (revoked or mistyped)
403The account is suspended, or the API is not open to it yet
429Over the per-minute or per-day limit (with Retry-After)

Objects

The objects the endpoints return, each described once. A type in a table that names one links here.

Meta

Licence, citation and sources, on every response.

Fields of Meta
FieldTypeDescription
licencestringThe data licence (CC BY 4.0).
licence_urlstringThe licence text.
citationstringHow to cite the data.
sourcesstringThe outside sources behind the data, with their terms and the credit each asks for.
docsstringThis API's guide.
as_ofstringWhen the data were built, where the resource records it.

Error

The body of every error response.

Fields of Error
FieldTypeDescription
errorstringWhat went wrong, in plain words.

Official

An official, as lists show them.

Fields of Official
FieldTypeDescription
idstringOfficial id: the bioguide id (Congress), the Open States id without ocd-person/ (state legislators) or gov-<slug> (governors). Use it with /v1/officials/{id}.
levelstringOne of: federal, state, governorLevel of government.
namestringName.
partystringOne of: D, R, I, OParty; O is any other, or none.
statestringState, as a two-letter code.
chamberstringOne of: house, senate, lower, upper, legislature, governorChamber or office.
districtstring or nullDistrict, where the seat has one.
photostring or nullPhoto: a site-relative or full URL.
csipnumber or nullIdeology (CSIP) from the latest validated run. 0 is the centre of the scale; negative is more liberal, positive more conservative.
statementsintegerStatements in the current window.
extremeRatenumber or nullShare of statements with an extreme label, current window (0 to 1).

Statement

A classified statement.

Fields of Statement
FieldTypeDescription
idstringStatement id: <source>:<source id>.
sourcestringOne of: tweets, tweets_state, tweets_governors, statements, statements_governors, newsletters, floor, state_floorWhere it comes from. tweets, tweets_state and tweets_governors are posts on X.
datestring (date)Date.
textstringThe whole text. Empty for posts on X: use tweet_id.
urlstring or nullThe original.
categoriesarray of stringOne of: attack_personal, attack_policy, policy, bipartisanship, creditclaimingKinds of statement the classifier found; a statement can have several or none.
policy_areasarray of stringPolicy areas it discusses (of 25).
extremeobject or nullSet when it uses an extreme label: the label and its target.
extreme.labelstringThe label(s) used.
extreme.targetstring or nullWho or what it describes.
attackobject or nullSet when it is a personal attack: the trait attacked and the target.
attack.typestring or nullThe trait(s) attacked.
attack.targetstring or nullThe person attacked.
personOfficialWho said it.
titlestring or nullPress release or newsletter subject; null for posts and floor speeches.
truncatedbooleanAlways false here: the API returns whole texts.
tweet_idstring or nullThe post's id on X (posts on X only).

Bill

A bill.

Fields of Bill
FieldTypeDescription
bill_idstringBill id.
jurisdictionstringUS for Congress, or a state's two-letter code.
sessionstringSession.
numberstringBill number.
titlestringTitle.
introducedstring (date) or nullDate introduced.
statusstringOne of: introduced, committee, passed_one, passed_both, lawThe furthest stage reached.
latest_actionstring or nullThe latest action.
latest_action_datestring (date) or nullIts date.
policy_areastring or nullPolicy area (of 25).
policy_area_sourcestring or nullOne of: crs, llmcrs when the Congressional Research Service assigned the area, llm when a language model did.
policy_area_crsstring or nullFederal only: the CRS policy area (of 33) before it is mapped to the 25.
urlstring or nullThe bill at its source.
sponsorsarray of OfficialSponsors.
n_cosponsorsintegerNumber of cosponsors.

Vote

A roll-call vote.

Fields of Vote
FieldTypeDescription
vote_idstringRoll-call id; federal ids are us-<congress>-<h|s>-<roll>.
datestring (date)Date of the vote.
chamberstringOne of: house, senate, lower, upper, legislature, governorChamber.
billstring or nullThe bill voted on, if any.
bill_titlestring or nullIts title.
questionstringThe question put to the vote.
resultstringThe result, as recorded.
marginnumber or nullMargin of the result (smaller is closer).
party_splitobjectYeas and nays by party (D, R, I, O).
party_split.<key>.yeaintegerYeas.
party_split.<key>.nayintegerNays.
key_reasonsarray of stringOne of: law, close, crossover, salientWhy it is a key vote: law (became law), close (decided by under 10%), crossover (at least 10% of a party voted against its majority), salient (one of the 25 bills officials mention most).
urlstring or nullThe roll call at its source.
jurisdictionstringUS, or a state's two-letter code.
yeainteger or nullYeas.
nayinteger or nullNays.
keybooleanWhether it is a key vote.

OfficialVote

A roll call, with how one official voted.

Fields of OfficialVote
FieldTypeDescription
vote_idstringRoll-call id; federal ids are us-<congress>-<h|s>-<roll>.
datestring (date)Date of the vote.
chamberstringOne of: house, senate, lower, upper, legislature, governorChamber.
billstring or nullThe bill voted on, if any.
bill_titlestring or nullIts title.
questionstringThe question put to the vote.
resultstringThe result, as recorded.
marginnumber or nullMargin of the result (smaller is closer).
party_splitobjectYeas and nays by party (D, R, I, O).
party_split.<key>.yeaintegerYeas.
party_split.<key>.nayintegerNays.
key_reasonsarray of stringOne of: law, close, crossover, salientWhy it is a key vote: law (became law), close (decided by under 10%), crossover (at least 10% of a party voted against its majority), salient (one of the 25 bills officials mention most).
urlstring or nullThe roll call at its source.
positionstringOne of: yea, nay, present, not_votingHow the official voted.
with_partyboolean or nullWhether the vote was with the majority of the official's party.

SimilarBills

Fields of SimilarBills
FieldTypeDescription
billobjectThe bill asked about.
bill.bill_idstringBill id.
bill.jurisdictionstringState, as a two-letter code.
bill.numberstringBill number.
bill.yearinteger or nullYear.
bill.titlestringTitle.
bill.became_lawbooleanWhether it became law.
thresholdnumberThe similarity a bill needs to count as the same.
similararray of objectThe same proposal in other states.
similar[].bill_idstringBill id.
similar[].jurisdictionstringState, as a two-letter code.
similar[].numberstringBill number.
similar[].yearinteger or nullYear.
similar[].titlestringTitle.
similar[].became_lawbooleanWhether it became law.
similar[].similaritynumberCosine similarity of the two texts.

BulkFile

A bulk file (further fields come from the files' manifest).

Fields of BulkFile
FieldTypeDescription
namestringName, for /v1/bulk/{name}.
descriptionstringWhat the file holds.
rowsintegerRows.
bytesintegerSize of the zip.
formatsarray of stringFormats in the zip.
downloadstringWhere to download it.

Usage

Fields of Usage
FieldTypeDescription
limitsobjectYour account's limits.
limits.requests_per_minuteintegerPer minute.
limits.requests_per_dayintegerPer day (UTC).
limits.downloads_per_dayintegerBulk downloads per day (UTC).
todayobject
today.requestsintegerRequests today (UTC).
today.by_resourceobjectRequests today by resource (statements, officials, …).
daysarray of objectThe last 30 days with requests.
days[].datestringDay, as YYYYMMDD (UTC).
days[].requestsintegerRequests that day.

Back to topThe API guideTerms of use