Developers
Call the REST API from your app, or connect a coding agent to Diurna's hosted MCP server. Both read the same official law corpus with citations and source links.
United States Code and 9 state codes loaded in Diurna.
1. Run a search with no key
Catalog reads such as search do not require an API key. Run this from a terminal (limit: 20 requests a minute per client).
curl -sS 'https://trydiurna.com/api/v1/search?q=270.30&limit=5'2. Read a real record in the response
Each hit includes citation, jurisdiction, and fields you can render in your app.
{ "results": [ { "doc_type": "section", "title": "Issuance, Renewal and Conditions of Facility Permits", "citation": "250-RICR-140-10-1 § 1.9", "jurisdiction": "RI" } ], "next_cursor": null }3. Create a key for follows and webhooks
Open Settings › API keys and create a Team key when you need follows, the change feed, directory tools, or signed webhooks. Copy the secret when it is shown once.
API v1
API guide
Search official law from your application, or connect a coding agent to the hosted MCP server.
REST API reference lists every v1 operation. Download the contract at GET /api/v1/openapi.json.
Create a key in Settings. The secret is shown once.
Runnable SDK and MCP recipes are in the Cookbook.
Basehttps://trydiurna.com
How Diurna compares with other legal data sources: Alternatives
Authentication
Send the key in the X-Api-Key header. A session cookie does not authenticate these routes, and an API key does not authenticate private matter reads.
Unversioned /api paths still run. They send Deprecation and Sunset headers with a Link to the matching v1 path.
| Surface | Credential | Header |
|---|---|---|
| Catalog reads | None Search, statutes, bills, CFR, lookup, jurisdictions, coverage, source registry | None |
| Account routes | API key from Settings. The secret is shown once. Follows, the change feed, and evidence packets | X-Api-Key |
| Directory and webhooks | API key on the Team plan Members, committees, and webhook endpoints | X-Api-Key |
| Private matter reads | Verified account session. API keys are rejected. Described at /developers/api and /developers/mcp | Session cookie |
| MCP | Same rule as the tool. The key does not create a session. https://trydiurna.com/api/mcp | X-Api-Key on POST /api/mcp |
Rate limits
Limits are counted per minute. Responses include RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset (seconds until the window resets), and RateLimit-Policy.
A policy named "key" belongs to that API key. "account" is a signed-in account. "ip" is the caller address.
| Limit | Window | Applies to |
|---|---|---|
| 20 requests | 1 minute, per client | GET /api/v1/search |
| 120 requests | 1 minute, shared by every client | Search, in addition to the per-client cap |
| 60 requests | 1 minute, per client | Single-record reads, lookup, and webhook calls |
| 60 requests | 1 minute, per client | Bills, CFR, jurisdictions, coverage, source registry, and the directory |
| 20 Free, 120 Pro, 600 Team | 1 minute, per API key | GET /api/v1/changes and evidence packets |
| 30 Free, 120 Pro, 600 Team | 1 minute, per API key | GET and POST /api/v1/follows |
| 30 Free, 120 Pro, 600 Team | 1 minute, per API key | MCP alert tools |
| 60 refills, capacity 30 | 1 minute, per API key | Feed tools get_feed, get_person, get_institution, and get_topic |
MCP
The server is POST https://trydiurna.com/api/mcp. Call tools/list for the tools on this host. The install buttons add that endpoint. They do not grant a verified account session.
Copy-paste setup for Cursor, Claude, Codex, VS Code, ChatGPT, OpenCode, and Grok Bot lives on Add Diurna to your agent.
Workflow skills (research a statute, track a bill, local ordinances, cite check) are listed on /skills. Each skill is a fetchable SKILL.md with MCP steps.
Private matter and review tools reject Authorization and X-Api-Key, including when a session is also present. Those reads are described at MCP.
Hosted MCP browser sign-in uses OAuth at /api/mcp/oauth. Your agent opens a browser window, you sign in to Diurna, and the client receives a scoped bearer token. No API key goes in the install URL.
- Click Add to Cursor or paste the deeplink. Cursor asks before installing.
- For account tools, set
DIURNA_API_KEYin your environment. Cursor substitutes${env:DIURNA_API_KEY}in the header. - For browser sign-in, use the OAuth config with no API key in the install payload.
- Public catalog tools answer without a key. Do not put the secret in the JSON file.
{
"mcpServers": {
"diurna": {
"type": "http",
"url": "https://trydiurna.com/api/mcp",
"headers": {
"X-Api-Key": "${env:DIURNA_API_KEY}"
}
}
}
}| Tool | What it does |
|---|---|
search | Search statutes, bills, and ordinances. |
search_laws | Full-text search over loaded code, bills, ordinances, court opinions, executive orders, and Code of Federal Regulations sections. |
lookup_citation | Look up every document matching a citation. |
get_statute | Get one statute by id or citation, including citation and source_url. |
get_section | Get a code section by section_id or citation, including version history, citation, and source_url. |
get_many | Fetch up to 100 code sections in one call by section_id or citation. |
get_bill | Get a bill by bill_id or citation, including versions, citation, and source_url. |
get_document | Get a section, session_law, ordinance, bill, executive_order, or cfr section by doc_type and document_id, including a page of version metadata. |
get_cfr_section | Get one Code of Federal Regulations section by id or citation, for example 1 CFR 1.1. |
list_cfr_parts | List loaded Code of Federal Regulations parts. |
list_jurisdictions | List jurisdictions with document counts and optional type filter. |
get_coverage | Coverage manifest snapshot for all jurisdictions, or rows for one jurisdiction when jurisdiction is set. |
list_source_registry | List monitored sources and computed health. |
list_members | List current legislators from official legislature sites and Congress.gov. |
get_member | Get one legislator by id, including official contacts, committees, sponsorships, and roll-call positions. |
list_committees | List legislative committees from official sources. |
get_committee | Get one committee and its official membership. |
list_local_meetings | List local body meetings, King County first. |
get_local_meeting | Get one local meeting with agenda items, minute files, and roll-call votes. |
list_bill_amendments | List the statute sections a stored bill amends, adds, repeals, or enacts. |
follow | Idempotently follow a place, topic, person, institution, legislator (member), committee, agency, council, statute, bill, ordinance, or CFR part (target_type cfr_part, target_id a part id or citation such as 40 CFR 60). |
unfollow | Idempotently remove a follow by target for the authenticated user. |
list_changes | Cursor-paginated document and development changes, including CFR section amendments (kind cfr). |
changes_feed | List statute, bill, and ordinance changes. |
get_evidence | Return the evidence packet for one development. |
get_evidence_packet | Alias of get_evidence. |
list_alerts | List alerts for the API key account. |
list_webhook_endpoints | List the authenticated user's enabled webhook endpoints. |
create_webhook_endpoint | Save an https webhook endpoint. |
delete_webhook_endpoint | Disable a webhook endpoint for the authenticated user. |
POST /api/mcp
curl -sS -X POST 'https://trydiurna.com/api/mcp' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search","arguments":{"query":"270.30"}}}'Search
Search laws
GET/api/v1/search
Full-text search over loaded statutes, bills, ordinances, session laws, executive orders, court opinions, and Code of Federal Regulations sections. Filter by jurisdiction code, government level (state, county, city), document category (code, ordinance, bill, opinion, regulation), document type, bill sponsor, issuing agency, or legislative session. Every hit includes citation and source_url. Set include_text=true to return official body text in each hit without a follow-up read. format=highlights returns official excerpts (HighlightsResponse). format=answer returns a short cited answer (CitedAnswer). fields and max_tokens shorten the body. Omit format, fields, and max_tokens for the full page.
| Parameter | In | Type |
|---|---|---|
qSearch text with AND, OR, NOT, quoted phrases, parentheses, and NEAR/n proximity. Saved alerts use the same syntax. The MCP field name is query. The API rejects queries shorter than three characters, except two-letter catalog jurisdiction codes such as WA or RI. | query | string |
jurisdiction optional | query | string |
level optional | query | state | county | city |
category optionalOne search category. Mutually exclusive with categories and type parameters. | query | code | ordinance | bill | opinion | regulation |
categories optionalComma-separated search categories (code, ordinance, bill, opinion, regulation). | query | string |
type optionalOne document type. Mutually exclusive with types and categories. | query | string |
types optionalComma-separated document types. Mutually exclusive with type and categories. | query | string |
sort optional | query | relevance | newest | citation |
from optional | query | string |
to optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
include_text optionalWhen true, each hit includes official body text in body, capped by text_max_chars and plan limits. | query | boolean |
text_max_chars optionalPer-result character cap when include_text is true. Defaults to the caller plan cap. | query | integer |
format optionalhighlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record. | query | highlights | answer |
fields optionalComma-separated properties to keep. citation and source_url remain on every record that has them. | query | string |
max_tokens optionalUpper bound for the JSON body. Counted as 4 characters per token. Citations are kept. | query | integer |
sponsor optionalBill sponsor name filter. | query | string |
agency optionalIssuing agency filter for CFR sections. | query | string |
session optionalLegislative session filter for bills. | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/search
curl -sS 'https://trydiurna.com/api/v1/search?q=270.30&limit=5'Look up a citation
GET/api/v1/lookup
Every document matching a citation. The route does not pick one match silently.
| Parameter | In | Type |
|---|---|---|
citation | query | string |
jurisdiction optional | query | string |
session optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/lookup
curl -sS 'https://trydiurna.com/api/v1/lookup?citation=RCW%209A.36.011&jurisdiction=WA'List jurisdictions
GET/api/v1/jurisdictions
| Parameter | In | Type |
|---|---|---|
type optional | query | federal | state | county | city | territory | tribal |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/jurisdictions
curl -sS 'https://trydiurna.com/api/v1/jurisdictions?type=federal'List legislative sessions
GET/api/v1/sessions
Legislative sessions loaded in the catalog, with dates and a current-session flag. Each row links to bill search for that session.
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/sessions
curl -sS 'https://trydiurna.com/api/v1/sessions?jurisdiction=WA'Read coverage
GET/api/v1/coverage
Returns the full coverage manifest snapshot when jurisdiction is omitted. Pass jurisdiction for the same per-jurisdiction rows as GET /api/coverage.
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
data_type optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/coverage
curl -sS 'https://trydiurna.com/api/v1/coverage?jurisdiction=WA'Browse the loaded corpus map
GET/api/v1/corpus-map
Hierarchical map of jurisdictions, document types, statute codes and titles, and CFR titles and parts. Counts and last_updated_at come from stored rows only. Optional path drills down, for example WA, WA/section, WA/section/RCW, or cfr/1. Public. No API key.
| Parameter | In | Type |
|---|---|---|
path optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/corpus-map
curl -sS 'https://trydiurna.com/api/v1/corpus-map'List monitored sources
GET/api/v1/source-registry
Public source health. Payment is not required.
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
document_class optional | query | string |
status optional | query | working | delayed | partial | unavailable | not monitored |
supported optional | query | boolean |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/source-registry
curl -sS 'https://trydiurna.com/api/v1/source-registry?jurisdiction=WA'Extraction
Extract structured fields
POST/api/v1/extract
Extract fields from Diurna sections, bills, and ordinances. Send a JSON schema plus document ids or a search query. A search reads the first five matching sections, bills, or ordinances. Each value is an exact span of loaded Diurna text and includes the source section plus character indexes into that text window. String, number, and boolean fields match a line labeled with the property name or title. Enum values match the official wording. When a model is configured, a quote is kept only when it is copied exactly and sits beside its label or equals an enum value. Text that is not in the loaded document is dropped. Requires X-Api-Key.
JSON body
{
"schema": {
"type": "object",
"properties": {
"effective_date": {
"type": "string",
"title": "Effective date"
},
"status": {
"type": "string",
"enum": [
"enacted",
"pending"
]
}
},
"required": [
"effective_date"
]
},
"documents": [
{
"doc_type": "section",
"id": "00000000-0000-4000-8000-000000000050"
}
]
}Try it in the interactive OpenAPI reference
POST /api/v1/extract
curl -sS -X POST 'https://trydiurna.com/api/v1/extract' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"schema":{"type":"object","properties":{"effective_date":{"type":"string","title":"Effective date"},"status":{"type":"string","enum":["enacted","pending"]}},"required":["effective_date"]},"documents":[{"doc_type":"section","id":"00000000-0000-4000-8000-000000000050"}]}'Statutes
Get a statute by citation
GET/api/v1/sections
Looks up one code section by official citation. format=highlights returns official excerpts (HighlightsResponse). format=answer returns a short cited answer (CitedAnswer). q chooses the excerpts. Omit format, fields, and max_tokens for the full section. Pass diff_from as a version id or YYYY-MM-DD date to include a unified text diff and changes to effective date, status, title, and citations.
| Parameter | In | Type |
|---|---|---|
citation | query | string |
jurisdiction optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
q optionalTerms used to choose excerpts when format is highlights or answer. | query | string |
format optionalhighlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record. | query | highlights | answer |
fields optionalComma-separated properties to keep. citation and source_url remain on every record that has them. | query | string |
max_tokens optionalUpper bound for the JSON body. Counted as 4 characters per token. Citations are kept. | query | integer |
diff_from optionalVersion id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations. | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/sections
curl -sS 'https://trydiurna.com/api/v1/sections?citation=RCW%209A.36.011&jurisdiction=WA'Get a statute by id
GET/api/v1/sections/{id}
One code section by id. format=highlights returns official excerpts (HighlightsResponse). format=answer returns a short cited answer (CitedAnswer). q chooses the excerpts. Omit format, fields, and max_tokens for the full section. Pass diff_from as a version id or YYYY-MM-DD date to include a unified text diff and changes to effective date, status, title, and citations.
| Parameter | In | Type |
|---|---|---|
id | path | string |
diff_from optionalVersion id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations. | query | string |
q optionalTerms used to choose excerpts when format is highlights or answer. | query | string |
format optionalhighlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record. | query | highlights | answer |
fields optionalComma-separated properties to keep. citation and source_url remain on every record that has them. | query | string |
max_tokens optionalUpper bound for the JSON body. Counted as 4 characters per token. Citations are kept. | query | integer |
Try it in the interactive OpenAPI reference
GET /api/v1/sections/{id}
curl -sS 'https://trydiurna.com/api/v1/sections/11111111-1111-4111-8111-111111111111'Statute version timeline
GET/api/v1/sections/{id}/timeline
Chronological list of stored section versions with links to session law, bill, legislative history, citing opinions, and consecutive compare hrefs when data exists. Requires X-Api-Key and a plan that includes redlines and version compare.
| Parameter | In | Type |
|---|---|---|
id | path | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/sections/{id}/timeline
curl -sS 'https://trydiurna.com/api/v1/sections/11111111-1111-4111-8111-111111111111/timeline' \
-H "X-Api-Key: $DIURNA_API_KEY"Batch-fetch code sections
POST/api/v1/sections/batch
Fetch up to 100 sections by section_id or citation. Returns each record and per-item errors. Omit async for synchronous responses on small lists. Set async to queue a job, then poll GET /api/v1/sections/batch/{id}. Results are kept for 24 hours. Optional webhook_id sends signed started and completed events. Requires X-Api-Key. Metering counts each item. POST /api/v1/usage/preview quotes the published plan price before the batch runs and does not start the job.
JSON body
{
"items": "example"
}Try it in the interactive OpenAPI reference
POST /api/v1/sections/batch
curl -sS -X POST 'https://trydiurna.com/api/v1/sections/batch' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"items":"example"}'Poll a batch section job
GET/api/v1/sections/batch/{id}
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
GET /api/v1/sections/batch/{id}
curl -sS 'https://trydiurna.com/api/v1/sections/batch/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"Cancel a batch section job
DELETE/api/v1/sections/batch/{id}
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
DELETE /api/v1/sections/batch/{id}
curl -sS -X DELETE 'https://trydiurna.com/api/v1/sections/batch/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"Compare two stored version ids
POST/api/v1/versions/compare
Compare two stored official version ids on the same document. Returns a structured diff with unified text and field changes. Requires X-Api-Key and a plan that includes redlines and version compare.
JSON body
{
"from_version_id": "00000000-0000-4000-8000-000000000041",
"to_version_id": "00000000-0000-4000-8000-000000000042"
}Try it in the interactive OpenAPI reference
POST /api/v1/versions/compare
curl -sS -X POST 'https://trydiurna.com/api/v1/versions/compare' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"from_version_id":"00000000-0000-4000-8000-000000000041","to_version_id":"00000000-0000-4000-8000-000000000042"}'Exports
Export a jurisdiction corpus
POST/api/v1/exports/jurisdiction
Queue a JSONL export of loaded code sections for one jurisdiction. Optional code_name or title_number narrows the export. Poll GET /api/v1/exports/jurisdiction/{id} for a presigned download URL. Optional webhook_id sends signed completion events. Requires X-Api-Key. POST /api/v1/usage/preview quotes the published plan price before the export runs and does not start the job.
JSON body
{
"jurisdiction": "WA"
}Try it in the interactive OpenAPI reference
POST /api/v1/exports/jurisdiction
curl -sS -X POST 'https://trydiurna.com/api/v1/exports/jurisdiction' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"jurisdiction":"WA"}'Poll a jurisdiction export job
GET/api/v1/exports/jurisdiction/{id}
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
GET /api/v1/exports/jurisdiction/{id}
curl -sS 'https://trydiurna.com/api/v1/exports/jurisdiction/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"Cancel a jurisdiction export job
DELETE/api/v1/exports/jurisdiction/{id}
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
DELETE /api/v1/exports/jurisdiction/{id}
curl -sS -X DELETE 'https://trydiurna.com/api/v1/exports/jurisdiction/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"Bills
List bills
GET/api/v1/bills
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/bills
curl -sS 'https://trydiurna.com/api/v1/bills?jurisdiction=WA'Get a bill
GET/api/v1/bills/{id}
One bill by id. format=highlights returns official excerpts (HighlightsResponse). format=answer returns a short cited answer (CitedAnswer). q chooses the excerpts. Omit format, fields, and max_tokens for the full bill. Pass diff_from as a version id or YYYY-MM-DD date to include a unified text diff and changes to effective date, status, title, and citations.
| Parameter | In | Type |
|---|---|---|
id | path | string |
diff_from optionalVersion id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations. | query | string |
q optionalTerms used to choose excerpts when format is highlights or answer. | query | string |
format optionalhighlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record. | query | highlights | answer |
fields optionalComma-separated properties to keep. citation and source_url remain on every record that has them. | query | string |
max_tokens optionalUpper bound for the JSON body. Counted as 4 characters per token. Citations are kept. | query | integer |
Try it in the interactive OpenAPI reference
GET /api/v1/bills/{id}
curl -sS 'https://trydiurna.com/api/v1/bills/22222222-2222-4222-8222-222222222222'Regulations
List CFR sections
GET/api/v1/cfr
Loaded Code of Federal Regulations sections. Filter by title, part, citation, or query. Each section includes citation, hierarchy, amendment date, and source_url.
| Parameter | In | Type |
|---|---|---|
title optional | query | integer |
part optional | query | string |
citation optional | query | string |
query optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/cfr
curl -sS 'https://trydiurna.com/api/v1/cfr?title=40&part=60&citation=RCW%209A.36.011'List CFR parts
GET/api/v1/cfr/parts
Loaded Code of Federal Regulations parts. Optional title is a title number from 1 to 50. Each part includes citation and source_url.
| Parameter | In | Type |
|---|---|---|
title optional | query | integer |
limit optional | query | integer |
Try it in the interactive OpenAPI reference
GET /api/v1/cfr/parts
curl -sS 'https://trydiurna.com/api/v1/cfr/parts?title=40'Get a CFR section
GET/api/v1/cfr/{id}
One Code of Federal Regulations section, including the text stored from the GovInfo granule, hierarchy, amendment date, citation, and the eCFR source_url. format=highlights returns official excerpts (HighlightsResponse). format=answer returns a short cited answer (CitedAnswer). q chooses the excerpts. Omit format, fields, and max_tokens for the full section. Pass diff_from as a version id or YYYY-MM-DD date to include a unified text diff and changes to effective date, status, title, and citations.
| Parameter | In | Type |
|---|---|---|
id | path | string |
diff_from optionalVersion id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations. | query | string |
q optionalTerms used to choose excerpts when format is highlights or answer. | query | string |
format optionalhighlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record. | query | highlights | answer |
fields optionalComma-separated properties to keep. citation and source_url remain on every record that has them. | query | string |
max_tokens optionalUpper bound for the JSON body. Counted as 4 characters per token. Citations are kept. | query | integer |
Try it in the interactive OpenAPI reference
GET /api/v1/cfr/{id}
curl -sS 'https://trydiurna.com/api/v1/cfr/11111111-1111-4111-8111-111111111111'Members
List members
GET/api/v1/directory/members
Current legislators from official legislature sites and Congress.gov. Requires the Team plan.
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
chamber optional | query | house | senate | unicameral | council |
q optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/directory/members
curl -sS 'https://trydiurna.com/api/v1/directory/members?jurisdiction=WA' \
-H "X-Api-Key: $DIURNA_API_KEY"Get a member
GET/api/v1/directory/members/{id}
One legislator, including official contacts, committees, sponsorships, and roll-call positions.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
GET /api/v1/directory/members/{id}
curl -sS 'https://trydiurna.com/api/v1/directory/members/mem_wa_example' \
-H "X-Api-Key: $DIURNA_API_KEY"List committees
GET/api/v1/directory/committees
| Parameter | In | Type |
|---|---|---|
jurisdiction optional | query | string |
chamber optional | query | house | senate | unicameral | joint | council |
q optional | query | string |
limit optional | query | integer |
cursor optional | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/directory/committees
curl -sS 'https://trydiurna.com/api/v1/directory/committees?jurisdiction=WA' \
-H "X-Api-Key: $DIURNA_API_KEY"Follows
List follows
GET/api/v1/follows
Follows saved for the API key account. Requires X-Api-Key.
Try it in the interactive OpenAPI reference
GET /api/v1/follows
curl -sS 'https://trydiurna.com/api/v1/follows' \
-H "X-Api-Key: $DIURNA_API_KEY"Follow or unfollow
POST/api/v1/follows
Idempotent follow write for a statute, bill, ordinance, or CFR part (targetType cfr_part). kind and id are accepted aliases of targetType and targetId. Requires X-Api-Key.
JSON body
{
"targetType": "statute",
"targetId": "11111111-1111-4111-8111-111111111111",
"followed": true
}Try it in the interactive OpenAPI reference
POST /api/v1/follows
curl -sS -X POST 'https://trydiurna.com/api/v1/follows' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"targetType":"statute","targetId":"11111111-1111-4111-8111-111111111111","followed":true}'Change feed
Read the change feed
GET/api/v1/changes
Cursor page of document and development changes in strictly increasing recording order (seq). Delivery is at-least-once: use change_id (same as id) to dedupe. Pass next_cursor back as since; every page returns next_cursor and has_more. Tombstones (repeal and disappearance) appear as normal items with removed=true. Optional filters jurisdiction, session, kind, citation_prefix, and part apply to every page of a cursor. Rows may be purged after 400 days; a since cursor older than the retained window returns 410 cursor_expired with resync guidance. CFR section amendments use kind cfr. Each item includes citation and source_url. Set include_diff=true to attach structured diffs on up to the first 20 items; otherwise diff is an empty shell. Requires X-Api-Key. This is not the older unversioned /api/changes list.
| Parameter | In | Type |
|---|---|---|
since optionalOpaque cursor from the previous next_cursor. Omit on the first page. Cursors older than the documented retention window return cursor_expired (410). | query | string |
limit optional | query | integer |
jurisdiction optionalWhen set, only changes in this jurisdiction are returned. The filter applies to every page of the cursor. | query | string |
session optionalLegislative session id or label (for example 2025-26). Matches bill-shaped rows with that session. The filter applies to every page of the cursor. | query | string |
kind optionalChange kind. cfr is a Code of Federal Regulations section change. | query | string |
citation_prefix optional | query | string |
part optionalCFR part citation such as 40 CFR 60. Matches that part and its sections, not a longer part number such as 40 CFR 600. | query | string |
include_diff optionalWhen true, populate structured diffs on up to the first 20 items in the page. Default false returns empty diff shells. | query | boolean |
Try it in the interactive OpenAPI reference
GET /api/v1/changes
curl -sS 'https://trydiurna.com/api/v1/changes?jurisdiction=WA&part=60' \
-H "X-Api-Key: $DIURNA_API_KEY"Read a development's legal status
GET/api/v1/developments/status/{doc_type}/{id}
Lifecycle and the next source-stated deadline for one bill, ordinance, session law, executive order, code section, or regulation. stage_label is the publisher stage when one is stored, such as Introduced, In committee, Passed, Effective, or Comment period. next_decision stays null when no source states a date. No API key.
| Parameter | In | Type |
|---|---|---|
doc_type | path | bill | ordinance | session_law | executive_order | section | regulation |
id | path | string |
as_of optionalCalendar day used to read the lifecycle. Defaults to the database current date. | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/developments/status/{doc_type}/{id}
curl -sS 'https://trydiurna.com/api/v1/developments/status/bill/66666666-6666-4666-8666-666666666666'Webhooks
List webhook endpoints
GET/api/v1/webhooks
Enabled endpoints for the signed-in Team account. Secrets are not included.
Try it in the interactive OpenAPI reference
GET /api/v1/webhooks
curl -sS 'https://trydiurna.com/api/v1/webhooks' \
-H "X-Api-Key: $DIURNA_API_KEY"Create a webhook endpoint
POST/api/v1/webhooks
Saves an https endpoint. The signing secret is returned once.
JSON body
{
"url": "https://example.com/hooks/diurna"
}Try it in the interactive OpenAPI reference
POST /api/v1/webhooks
curl -sS -X POST 'https://trydiurna.com/api/v1/webhooks' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com/hooks/diurna"}'Disable a webhook endpoint
DELETE/api/v1/webhooks/{id}
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
DELETE /api/v1/webhooks/{id}
curl -sS -X DELETE 'https://trydiurna.com/api/v1/webhooks/55555555-5555-4555-8555-555555555555' \
-H "X-Api-Key: $DIURNA_API_KEY"Evidence
Get an evidence packet
GET/api/v1/developments/{id}/evidence
Evidence packet schema 1.3.0. Official citation, paste citation, issuing body, source health, source URL, version diff summary, fetch time, content hash, version history, current-through date, stored passages with reader links, legal status, as_of, and explicit gaps. Included with Pro. Requires X-Api-Key.
| Parameter | In | Type |
|---|---|---|
id | path | string |
as_of optionalCalendar day used to read the lifecycle. Defaults to the database current date. | query | string |
Try it in the interactive OpenAPI reference
GET /api/v1/developments/{id}/evidence
curl -sS 'https://trydiurna.com/api/v1/developments/66666666-6666-4666-8666-666666666666/evidence' \
-H "X-Api-Key: $DIURNA_API_KEY"Usage
Read usage and remaining quota
GET/api/v1/usage
Monthly counted requests, per-day counts by endpoint, and remaining rate-limit and batch quotas for the API key. Counted requests are not a separate charge. Requires X-Api-Key.
Try it in the interactive OpenAPI reference
GET /api/v1/usage
curl -sS 'https://trydiurna.com/api/v1/usage' \
-H "X-Api-Key: $DIURNA_API_KEY"Preview the cost of a bulk request
POST/api/v1/usage/preview
Quotes the published plan price and a separate charge of zero for a section batch or jurisdiction export. Does not record usage, reserve quota, or start the job. Requires X-Api-Key.
Try it in the interactive OpenAPI reference
POST /api/v1/usage/preview
curl -sS -X POST 'https://trydiurna.com/api/v1/usage/preview' \
-H "X-Api-Key: $DIURNA_API_KEY"Account
List recent requests and jobs
GET/api/v1/activity
Recent API and MCP calls for this key's account, plus bulk jobs. Each row has the endpoint, status, latency, key prefix, and error. Query strings, request bodies, and secrets are not stored. When zero data retention is enabled, error text is omitted.
Try it in the interactive OpenAPI reference
GET /api/v1/activity
curl -sS 'https://trydiurna.com/api/v1/activity' \
-H "X-Api-Key: $DIURNA_API_KEY"Read job errors
GET/api/v1/activity/jobs/{id}
Error details for one bulk job owned by this key's account. Item text is omitted when zero data retention is enabled.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
GET /api/v1/activity/jobs/{id}
curl -sS 'https://trydiurna.com/api/v1/activity/jobs/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"Research
Start a deep research job
POST/api/v1/research
Queue a multi-step research job over the Diurna corpus. The job searches and reads loaded official sources only. Poll GET /api/v1/research/{id} for status and, when complete, an answer with citations. Requires X-Api-Key. Jobs are kept for 24 hours.
JSON body
{
"question": "example",
"jurisdiction": "WA"
}Try it in the interactive OpenAPI reference
POST /api/v1/research
curl -sS -X POST 'https://trydiurna.com/api/v1/research' \
-H "X-Api-Key: $DIURNA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"question":"example","jurisdiction":"WA"}'Poll a deep research job
GET/api/v1/research/{id}
Read a research job started by this API key. Completed jobs include an answer and citations to loaded official sources.
| Parameter | In | Type |
|---|---|---|
id | path | string |
Try it in the interactive OpenAPI reference
GET /api/v1/research/{id}
curl -sS 'https://trydiurna.com/api/v1/research/11111111-1111-4111-8111-111111111111' \
-H "X-Api-Key: $DIURNA_API_KEY"