GraphQL API
Query the live, typed gateway at one endpoint. This reference describes the exposed schema directly, so you can build requests without relying on introspection.
Endpoint
POST https://api.archivist.dev/v1/graphqlAuthentication and request shape
Every POST /v1/graphql request must include an already-issued API key in the Authorization header as a bearer token. Requests without valid authentication are rejected; anonymous requests cannot access this endpoint. Keep the key in a server-side environment variable or secret manager. Do not put it in browser JavaScript, a mobile app, a public repository, or a NEXT_PUBLIC_* variable.
curl 'https://api.archivist.dev/v1/graphql' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
--data '{"query":"query { members { items { member_id } } }"}'Missing, malformed, or unknown bearer tokens receive HTTP 401 with AUTHENTICATION_ERROR. Revoked API keys or suspended customer accounts receive HTTP 403 with the same code.
Send JSON with a required string query and optional variables and operationName properties.
{
"query": "query { members { items { member_id } } }",
"variables": {},
"operationName": "Members"
}Typed query surface
The root fields below are the complete exposed query surface. Pass each field its named input object as input; all five return a paged result.
input: BillsInput- congress: Int
- Congress number to match.
- type: String
- Bill type such as hr or s.
- status: String
- Exact match to the Congress.gov latestAction.text stored for the bill.
- q: String
- Text search across the bill record.
- cursor: String
- Opaque cursor from a previous page.
- limit: Int
- Page size from 1 to 100; defaults to 25.
input: MembersInput- state: String
- Two-letter state or territory code, such as CA.
- chamber: String
- house or senate.
- congress: Int
- Congress number in which the member served.
- cursor: String
- Opaque cursor from a previous page.
- limit: Int
- Page size from 1 to 100; defaults to 25.
input: RegulatoryFilingsInput- agency_id: String
- Exact agency identifier.
- agency_name: String
- Case-insensitive agency-name match.
- type: RegulatoryFilingType
- RULE, PROPOSED_RULE, NOTICE, or PRESIDENTIAL_DOCUMENT.
- filing_year: Int
- Calendar year of the filing.
- filing_period: RegulatoryFilingPeriod
- Q1, Q2, Q3, Q4, or AMENDMENT.
- rIN: String
- Exact Regulation Identifier Number.
- docket_id: String
- Docket identifier contained by the filing.
- cursor: String
- Opaque cursor from a previous page.
- limit: Int
- Page size from 1 to 100; defaults to 25.
input: FederalBudgetsInput!- dataset: FederalBudgetDataset!
- APPROPRIATIONS or OUTLAYS.
- congress: Int
- Congress number to match.
- fiscal_year: Int
- Fiscal year to match.
- month: String
- OUTLAYS only; YYYY-MM.
- agency: String
- Case-insensitive agency-name match.
- bureau_code: String
- APPROPRIATIONS only; bureau code.
- account: String
- Case-insensitive account-title match.
- cursor: String
- Opaque cursor from a previous page.
- limit: Int
- Page size from 1 to 100; defaults to 25.
The dataset field is required. Use bureau_code with APPROPRIATIONS and month with OUTLAYS.
input: LobbyingDisclosuresInput- registrant_name: String
- Case-insensitive registrant-name match.
- registrant_id: String
- Exact registrant identifier.
- client_name: String
- Case-insensitive client-name match.
- client_id: String
- Exact client identifier.
- lobbyist_name: String
- Case-insensitive lobbyist-name match.
- filing_year: Int
- Calendar year of the filing.
- filing_period: LobbyingFilingPeriod
- Q1, Q2, Q3, Q4, or AMENDMENT.
- issue_area: String
- Issue code contained by the filing.
- agency_acted_on: String
- Agency contained by the filing.
- cursor: String
- Opaque cursor from a previous page.
- limit: Int
- Page size from 1 to 100; defaults to 25.
Cursor pagination
Every root query uses the same pagination inputs: cursor: String is an opaque value, and limit: Int accepts 1–100 and defaults to 25. The page response returns nextCursor; when it is non-null, pass that exact value as the next request’s cursor. A final page returns null.
{
"input": {
"limit": 25,
"cursor": "opaque-cursor-from-the-previous-response"
}
}Response envelopes
A successful request is HTTP 200 with a top-level data object. The selected root field contains items and nullable nextCursor.
{
"data": {
"members": {
"items": [],
"nextCursor": null
}
}
}GraphQL execution errors can accompany partial data, or make it null, in a top-level errors array. Read both keys when handling a 200 response.
Bills result
The exact-match filter is BillsInput.status: String. The selected Bill.status: String is nullable and contains the Congress.gov latest-action text captured by the sync. A non-null filter excludes bills with null or different status text.
bills returns BillsPage! with items: [Bill!]! and nextCursor: String. An exclamation mark means non-null; a type without it may be null.
Use bill(id: ID!): Bill to resolve one normalized bill by its table identifier. The field is nullable, so an unknown identifier returns bill: null without a GraphQL execution error.
query Bill($id: ID!) {
bill(id: $id) {
id
congress
type
number
officialTitle
status
introducedDate
memberName
memberBioguideId
memberByCongressKey
committeeNames
sourceUrl
lastSyncedAt
}
}| Field | Type | Meaning |
|---|---|---|
| id | ID! | Stable bill identifier. |
| congress | Int! | Congress number. |
| type | String! | Bill type, for example hr or s. |
| number | Int! | Bill number within its type and Congress. |
| officialTitle | String! | Official bill title. |
| status | String | Nullable Congress.gov latest-action text captured at sync time; null when the latest-action record is missing or malformed. |
| introducedDate | String | Nullable ISO date/time for introduction. |
| memberName | String | Nullable sponsor/member display name. |
| memberBioguideId | String | Nullable sponsor Bioguide identifier. |
| memberByCongressKey | String | Nullable per-Congress sponsor key. |
| committeeNames | String! | Committee names recorded on the bill. |
| sourceUrl | String | Nullable upstream source URL. |
| lastSyncedAt | String! | ISO date/time of the last mirror sync. |
Members result
members returns MembersPage! with items: [Member!]! and nextCursor: String.
| Field | Type | Meaning |
|---|---|---|
| member_id | ID! | Stable member identifier. |
| bioguide_id | ID! | Bioguide identifier; currently the same stable key. |
| name | String! | Member display name. |
| state | String | Nullable represented state or territory. |
| terms | [MemberTerm!]! | Non-null list of the member’s recorded terms. |
| Field | Type | Meaning |
|---|---|---|
| congress | Int! | Congress number for the term. |
| chamber | String! | House or Senate chamber. |
| party | String | Nullable party recorded for the term. |
Errors and status codes
| HTTP | Envelope | Meaning |
|---|---|---|
| 401 | { "errors": [{ "message": "Authentication failed", "extensions": { "code": "AUTHENTICATION_ERROR" } }] } | Missing, malformed, or unknown bearer token. |
| 403 | { "errors": [{ "message": "Authentication failed", "extensions": { "code": "AUTHENTICATION_ERROR" } }] } | Revoked API key or suspended customer account. |
| 429 | { "error": "Rate limit exceeded" } | Rate limited. Read the Retry-After header and retry after that many seconds. |
| 400 | { "errors": [{ "message": "..." }] } | Malformed request JSON, a missing string query, or invalid variables/operationName. |
| 200 | { "data": ..., "errors": [...] } | GraphQL execution or validation errors can accompany partial data or a null data value. |
| 500 | { "error": "Internal Server Error" } | Unexpected server failure. |
Runnable examples
These server-side curl requests include sample filters and first-page pagination variables. Replace the sample filters with your own; for later pages, pass the returned nextCursor as cursor. Set ARCHIVIST_KEY in your shell first; the bearer token never needs to appear in the query document.
curl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query Bills($input: BillsInput) {\n bills(input: $input) {\n items {\n id\n congress\n type\n number\n officialTitle\n status\n introducedDate\n memberName\n memberBioguideId\n committeeNames\n sourceUrl\n }\n nextCursor\n }\n}",
"variables": {
"input": { "congress": 118, "type": "hr", "q": "records", "limit": 25 }
}
}
JSON{
"data": {
"bills": {
"items": [{ "id": "118-hr-1", "officialTitle": "...", "number": 1 }],
"nextCursor": "opaque-cursor"
}
}
}curl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query Members($input: MembersInput) {\n members(input: $input) {\n items {\n member_id\n bioguide_id\n name\n state\n terms {\n congress\n chamber\n party\n }\n }\n nextCursor\n }\n}",
"variables": {
"input": { "state": "CA", "chamber": "house", "congress": 118, "limit": 25 }
}
}
JSON{
"data": {
"members": {
"items": [{
"member_id": "P000197",
"bioguide_id": "P000197",
"name": "...",
"state": "CA",
"terms": [{ "congress": 118, "chamber": "house", "party": "..." }]
}],
"nextCursor": null
}
}
}The filter matches the exact Congress.gov latestAction.text value shown in its Bill API reference. This is query syntax only; it does not imply any matching records are currently returned.
curl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query BillsByStatus($input: BillsInput) {\n bills(input: $input) {\n items {\n id\n congress\n type\n number\n officialTitle\n status\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"status": "Became Public Law No: 117-108.",
"cursor": null,
"limit": 25
}
}
}
JSONcurl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query CommitteeAssignments($input: CommitteeAssignmentsInput) {\n committeeAssignments(input: $input) {\n items {\n assignment_id\n committee_id\n member_id\n congress\n role\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"committee_id": "hsju00",
"congress": 118,
"cursor": null,
"limit": 25
}
}
}
JSONcurl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query LobbyingDisclosures($input: LobbyingDisclosuresInput) {\n lobbyingDisclosures(input: $input) {\n items {\n filing_id\n registrant_id\n registrant_name\n client_id\n client_name\n filing_period\n filing_year\n filing_date\n posted_date\n amount {\n value\n mandatory_discretionary\n }\n lobbyists {\n name\n bioguide_id\n }\n issues {\n code\n specific_issues\n }\n agencies\n source_url\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"client_name": "Helios",
"filing_year": 2025,
"cursor": null,
"limit": 25
}
}
}
JSONcurl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query FederalBudgets($input: FederalBudgetsInput!) {\n federalBudgets(input: $input) {\n items {\n __typename\n ... on Appropriation {\n account_id\n account_title\n agency\n bureau\n fiscal_year\n appropriation_amount {\n current\n mandatory_discretionary\n supplemental\n }\n treasury_symbol\n congress\n source_url\n }\n ... on Outlay {\n account_id\n fiscal_year\n month\n outlay_amount\n obligations_amount\n agency\n bureau\n congress\n }\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"dataset": "APPROPRIATIONS",
"fiscal_year": 2025,
"cursor": null,
"limit": 25
}
}
}
JSONVote records are not yet available from the data source. This shows supported query syntax only; no vote results are shown.
curl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query CongressionalVotes($input: CongressionalVotesInput) {\n congressionalVotes(input: $input) {\n items {\n vote_id\n chamber\n congress\n roll_call\n result\n yea\n nay\n bill_id\n member_rollups {\n member_id\n position\n }\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"chamber": "house",
"congress": 118,
"result": "passed",
"bill_id": null,
"cursor": null,
"limit": 25
}
}
}
JSONcurl 'https://api.archivist.dev/v1/graphql' \
-H "Authorization: Bearer $ARCHIVIST_KEY" \
-H 'Content-Type: application/json' \
--data @- <<'JSON'
{
"query": "query RegulatoryFilings($input: RegulatoryFilingsInput) {\n regulatoryFilings(input: $input) {\n items {\n filing_id\n agency_id\n agency_name\n title\n type\n rIN\n federal_register_citation\n publication_date\n effective_date\n comment_due_date\n agency_acted_on\n docket_ids\n source_url\n }\n nextCursor\n }\n}",
"variables": {
"input": {
"agency_id": "EPA",
"type": "PROPOSED_RULE",
"filing_year": 2025,
"filing_period": "Q1",
"cursor": null,
"limit": 25
}
}
}
JSON