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.

Team / API starts at $299 a month with 3 seats. Extra seats are $49 a month. See pricing

United States Code and 9 state codes loaded in Diurna.

  1. 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. 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. 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.

SurfaceCredentialHeader
Catalog readsNone
Search, statutes, bills, CFR, lookup, jurisdictions, coverage, source registry
None
Account routesAPI key from Settings. The secret is shown once.
Follows, the change feed, and evidence packets
X-Api-Key
Directory and webhooksAPI key on the Team plan
Members, committees, and webhook endpoints
X-Api-Key
Private matter readsVerified account session. API keys are rejected.
Described at /developers/api and /developers/mcp
Session cookie
MCPSame 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.

LimitWindowApplies to
20 requests1 minute, per clientGET /api/v1/search
120 requests1 minute, shared by every clientSearch, in addition to the per-client cap
60 requests1 minute, per clientSingle-record reads, lookup, and webhook calls
60 requests1 minute, per clientBills, CFR, jurisdictions, coverage, source registry, and the directory
20 Free, 120 Pro, 600 Team1 minute, per API keyGET /api/v1/changes and evidence packets
30 Free, 120 Pro, 600 Team1 minute, per API keyGET and POST /api/v1/follows
30 Free, 120 Pro, 600 Team1 minute, per API keyMCP alert tools
60 refills, capacity 301 minute, per API keyFeed 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.

  1. Click Add to Cursor or paste the deeplink. Cursor asks before installing.
  2. For account tools, set DIURNA_API_KEY in your environment. Cursor substitutes ${env:DIURNA_API_KEY} in the header.
  3. For browser sign-in, use the OAuth config with no API key in the install payload.
  4. Public catalog tools answer without a key. Do not put the secret in the JSON file.

Cursor

{
  "mcpServers": {
    "diurna": {
      "type": "http",
      "url": "https://trydiurna.com/api/mcp",
      "headers": {
        "X-Api-Key": "${env:DIURNA_API_KEY}"
      }
    }
  }
}
ToolWhat it does
searchSearch statutes, bills, and ordinances.
search_lawsFull-text search over loaded code, bills, ordinances, court opinions, executive orders, and Code of Federal Regulations sections.
lookup_citationLook up every document matching a citation.
get_statuteGet one statute by id or citation, including citation and source_url.
get_sectionGet a code section by section_id or citation, including version history, citation, and source_url.
get_manyFetch up to 100 code sections in one call by section_id or citation.
get_billGet a bill by bill_id or citation, including versions, citation, and source_url.
get_documentGet 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_sectionGet one Code of Federal Regulations section by id or citation, for example 1 CFR 1.1.
list_cfr_partsList loaded Code of Federal Regulations parts.
list_jurisdictionsList jurisdictions with document counts and optional type filter.
get_coverageCoverage manifest snapshot for all jurisdictions, or rows for one jurisdiction when jurisdiction is set.
list_source_registryList monitored sources and computed health.
list_membersList current legislators from official legislature sites and Congress.gov.
get_memberGet one legislator by id, including official contacts, committees, sponsorships, and roll-call positions.
list_committeesList legislative committees from official sources.
get_committeeGet one committee and its official membership.
list_local_meetingsList local body meetings, King County first.
get_local_meetingGet one local meeting with agenda items, minute files, and roll-call votes.
list_bill_amendmentsList the statute sections a stored bill amends, adds, repeals, or enacts.
followIdempotently 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).
unfollowIdempotently remove a follow by target for the authenticated user.
list_changesCursor-paginated document and development changes, including CFR section amendments (kind cfr).
changes_feedList statute, bill, and ordinance changes.
get_evidenceReturn the evidence packet for one development.
get_evidence_packetAlias of get_evidence.
list_alertsList alerts for the API key account.
list_webhook_endpointsList the authenticated user's enabled webhook endpoints.
create_webhook_endpointSave an https webhook endpoint.
delete_webhook_endpointDisable 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

Look up a citation

GET/api/v1/lookup

Every document matching a citation. The route does not pick one match silently.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
citationquerystring
jurisdiction optionalquerystring
session optionalquerystring

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

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
type optionalqueryfederal | state | county | city | territory | tribal
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
data_type optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
path optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
document_class optionalquerystring
status optionalqueryworking | delayed | partial | unavailable | not monitored
supported optionalqueryboolean
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
API key
Rate limit
12 requests per minute per client.

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
citationquerystring
jurisdiction optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring
q optional
Terms used to choose excerpts when format is highlights or answer.
querystring
format optional
highlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record.
queryhighlights | answer
fields optional
Comma-separated properties to keep. citation and source_url remain on every record that has them.
querystring
max_tokens optional
Upper bound for the JSON body. Counted as 4 characters per token. Citations are kept.
queryinteger
diff_from optional
Version id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations.
querystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring
diff_from optional
Version id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations.
querystring
q optional
Terms used to choose excerpts when format is highlights or answer.
querystring
format optional
highlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record.
queryhighlights | answer
fields optional
Comma-separated properties to keep. citation and source_url remain on every record that has them.
querystring
max_tokens optional
Upper bound for the JSON body. Counted as 4 characters per token. Citations are kept.
queryinteger

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.

Auth
API key, Pro plan
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
API key
Rate limit
60 requests per minute per client.

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}

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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}

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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.

Auth
API key, Pro plan
Rate limit
60 requests per minute per client.

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.

Auth
API key
Rate limit
60 requests per minute per client.

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}

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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}

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring
diff_from optional
Version id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations.
querystring
q optional
Terms used to choose excerpts when format is highlights or answer.
querystring
format optional
highlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record.
queryhighlights | answer
fields optional
Comma-separated properties to keep. citation and source_url remain on every record that has them.
querystring
max_tokens optional
Upper bound for the JSON body. Counted as 4 characters per token. Citations are kept.
queryinteger

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
title optionalqueryinteger
part optionalquerystring
citation optionalquerystring
query optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
title optionalqueryinteger
limit optionalqueryinteger

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring
diff_from optional
Version id or YYYY-MM-DD date. When set, the read includes a unified text diff and changes to effective date, status, title, and citations.
querystring
q optional
Terms used to choose excerpts when format is highlights or answer.
querystring
format optional
highlights returns the most relevant official excerpts with citation and source_url. answer returns a short cited answer. Omit format for the full record.
queryhighlights | answer
fields optional
Comma-separated properties to keep. citation and source_url remain on every record that has them.
querystring
max_tokens optional
Upper bound for the JSON body. Counted as 4 characters per token. Citations are kept.
queryinteger

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.

Auth
API key, Team plan
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
chamber optionalqueryhouse | senate | unicameral | council
q optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
API key, Team plan
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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

Auth
API key, Team plan
Rate limit
60 requests per minute per client.
ParameterInType
jurisdiction optionalquerystring
chamber optionalqueryhouse | senate | unicameral | joint | council
q optionalquerystring
limit optionalqueryinteger
cursor optionalquerystring

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.

Auth
API key
Rate limit
30 requests per minute on Free, 120 on Pro, and 600 on Team. The window belongs to the 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.

Auth
API key
Rate limit
30 requests per minute on Free, 120 on Pro, and 600 on Team. The window belongs to the 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.

Auth
API key
Rate limit
20 requests per minute on Free, 120 on Pro, and 600 on Team. The window belongs to the API key.
ParameterInType
since optional
Opaque cursor from the previous next_cursor. Omit on the first page. Cursors older than the documented retention window return cursor_expired (410).
querystring
limit optionalqueryinteger
jurisdiction optional
When set, only changes in this jurisdiction are returned. The filter applies to every page of the cursor.
querystring
session optional
Legislative session id or label (for example 2025-26). Matches bill-shaped rows with that session. The filter applies to every page of the cursor.
querystring
kind optional
Change kind. cfr is a Code of Federal Regulations section change.
querystring
citation_prefix optionalquerystring
part optional
CFR part citation such as 40 CFR 60. Matches that part and its sections, not a longer part number such as 40 CFR 600.
querystring
include_diff optional
When true, populate structured diffs on up to the first 20 items in the page. Default false returns empty diff shells.
queryboolean

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.

Auth
No API key
Rate limit
60 requests per minute per client.
ParameterInType
doc_typepathbill | ordinance | session_law | executive_order | section | regulation
idpathstring
as_of optional
Calendar day used to read the lifecycle. Defaults to the database current date.
querystring

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.

Auth
API key, Team plan
Rate limit
60 requests per minute per client.

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.

Auth
API key, Team plan
Rate limit
60 requests per minute per client.

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}

Auth
API key, Team plan
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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.

Auth
API key, Pro plan
Rate limit
20 requests per minute on Free, 120 on Pro, and 600 on Team. The window belongs to the API key.
ParameterInType
idpathstring
as_of optional
Calendar day used to read the lifecycle. Defaults to the database current date.
querystring

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.

Auth
API key
Rate limit
60 requests per minute per client.

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.

Auth
API key
Rate limit
60 requests per minute per client.

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.

Auth
API key
Rate limit
60 requests per minute per client.

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.

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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.

Auth
API key
Rate limit
12 requests per minute per client.

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.

Auth
API key
Rate limit
60 requests per minute per client.
ParameterInType
idpathstring

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"
Browse API reference