Developer API

Congressional Record API

Programmatic access to every congressional statement, with full-text keyword search, AI-powered semantic search, and structured browsing. Built for researchers, journalists, civic technologists, and anyone who needs reliable primary-source data from the United States Congress.

Authentication

All API endpoints live under /api/v1/* and require a valid API key. API keys are generated from your account.

Account required. Sign in and create an API key from your Account page.

When using authenticated access, include your key in the Authorization header:

HTTP Header
Authorization: Bearer YOUR_API_KEY
Authenticated API routes are under /api/v1/.

Base URL

All API requests should be made to:

Base URL
https://crec-website-be.onrender.com

All endpoints return JSON. Responses larger than 500 bytes are automatically gzip-compressed when the client sends Accept-Encoding: gzip.

Rate Limits

Current limits are endpoint-specific. Product API routes use key-based limits plus IP backstops.

Surface Endpoint Limit
/api/v1 /search 180/min per key (+ IP backstop)
/api/v1 /statements 300/min per key (+ IP backstop)
/api/v1 /keys 3/day per IP (verification request)

When a limit is exceeded, the API returns 429 Too Many Requests with an error object and message indicating when the window resets.

429 Response
{
  "error": {
    "type": "RateLimitError",
    "message": "Rate limit exceeded for api key route /api/v1/search: 180 requests/60s. Resets in 24s.",
    "status": 429
  },
  "detail": "Rate limit exceeded for api key route /api/v1/search: 180 requests/60s. Resets in 24s."
}

Error Handling

The API uses standard HTTP status codes. Errors return a frozen contract with an error object and legacy detail string.

Status Meaning Typical Cause
200 OK Request succeeded
400 Bad Request Invalid query parameters (e.g. bad mode value)
401 Unauthorized Missing or malformed Authorization header
403 Forbidden Invalid API key
429 Too Many Requests Rate limit exceeded
500 Internal Error Unexpected server-side failure
502 Bad Gateway Upstream service error (e.g. embedding generation failed)
503 Service Unavailable Service not configured (e.g. semantic search unavailable)
Error Response Example
{
  "error": {
    "type": "AuthError",
    "message": "Invalid API key",
    "status": 403
  },
  "detail": "Invalid API key"
}
GET /api/v1/statements

Retrieve congressional statements with optional filters. Returns an array of statement objects ordered by date (descending), then by topic group sequence. Ideal for browsing recent activity or fetching a specific day's proceedings.

Query Parameters

Parameter Type Default Description
date string Filter by date. Format: YYYY-MM-DD.
chamber string Filter by chamber: House, Senate, or Extensions of Remarks.
congress_number integer Filter by congress number (e.g. 119).
search string Case-insensitive text filter on speaker name or statement text.
topic_group_id string Return only statements belonging to a specific topic group.
limit integer 200 Max rows to return. Min 1, max 1000.

Example: Get a Single Day

cURL
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/statements?\
date=2025-03-15&\
limit=50"

Example: House Statements Only

cURL
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/statements?\
chamber=House&\
limit=100"
Response (Array)
[
  {
    "id": "a1b2c3d4-...",
    "name": "Nancy Pelosi",
    "chamber": "House",
    "date": "2025-03-15",
    "title": "HONORING THE LEGACY OF...",
    "text": "Mr. Speaker, I rise today...",
    "deliveryType": "spoken",
    "statementOrigin": "floor_speech",
    "wordCount": 523,
    "politicalParty": "Democrat",
    "state": "California",
    "district": "11",
    "website": "https://pelosi.house.gov",
    "pictureUrl": "https://...",
    "headerPages": "H1234-H1235",
    "contentPages": "H1234",
    "crecVolume": "171",
    "crecNumber": "47",
    "congressNumber": 119,
    "seq": 1,
    "groupCount": 1,
    "topicGroupId": "group-abc",
    "audioUrl": "https://crec.s3.us-east-2.amazonaws.com/...",
    "audioDurationMs": 95000,
    "videoClipUrl": null,
    "videoThumbnailUrl": null,
    "videoUrl": null,
    "videoStartTimestamp": null,
    "legislation": null,
    "sourcePdfUrls": ["https://..."],
    "artifacts": ["Amendment text..."]
  },
  ...
]
GET /api/v1/dates

Returns every date for which congressional statements are available, sorted newest-first. Use this to discover which dates have data before making more targeted queries.

Parameters

This endpoint takes no parameters.

Example

cURL
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/dates"
Response (Array of Strings)
[
  "2026-02-07",
  "2026-02-06",
  "2026-02-05",
  "2026-02-04",
  "2026-02-03",
  "2025-12-20",
  "2025-12-19",
  ...
]
Tip: Combine this with the /api/v1/statements endpoint to iterate over all available dates and build a complete local mirror of the Congressional Record.
GET /api/v1/browse/{date}

Returns statements for a specific date, pre-organized into three categories (Written Remarks, House Spoken Remarks, Senate Spoken Remarks) and further grouped by topic title. This mirrors the structure of the official Congressional Record.

Path Parameters

Parameter Type Description
date string Required. Date in YYYY-MM-DD format.

Example

cURL
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/browse/2025-03-15"
Response (Nested Object)
{
  "Written Remarks": {
    "HONORING THE LEGACY OF JOHN DOE": [
      {
        "id": "...",
        "name": "Rep. Jane Smith",
        "chamber": "House",
        "title": "HONORING THE LEGACY OF JOHN DOE",
        "text": "Mr. Speaker, I rise to honor...",
        "date": "2025-03-15",
        "seq": 1,
        "groupCount": 1,
        ...
      }
    ],
    "RECOGNIZING NATIONAL SCIENCE WEEK": [...]
  },
  "House Spoken Remarks": {
    "INFRASTRUCTURE INVESTMENT ACT": [
      { "id": "...", "name": "Rep. Jim Brown", "seq": 1, ... },
      { "id": "...", "name": "Rep. Amy Lee", "seq": 2, ... }
    ]
  },
  "Senate Spoken Remarks": {
    "NOMINATION OF...": [...]
  }
}
Structure: The response is a three-level nested object. Top level = category name, second level = topic title (string key), third level = array of statement objects ordered by their sequence number within the topic.

Statement Object Schema

Every statement in the API shares this common structure. Some fields may be null when data is not available.

Field Type Description
idstring (UUID)Unique statement identifier.
namestringSpeaker's full name (e.g. "Nancy Pelosi").
chamberstringHouse, Senate, or Extensions of Remarks.
datestringDate of the statement (YYYY-MM-DD).
titlestringTopic title from the Congressional Record.
textstringFull statement text.
deliveryTypestringHow the statement was delivered (e.g. spoken, extension_of_remarks).
statementOriginstringOrigin context (e.g. floor_speech).
wordCountintegerNumber of words in the statement.
politicalPartystringSpeaker's party (e.g. Democrat, Republican).
statestringSpeaker's state (e.g. California).
districtstring|nullSpeaker's congressional district (House only).
websitestring|nullSpeaker's official website URL.
pictureUrlstring|nullURL to the speaker's official portrait.
headerPagesstring|nullCREC header page range (e.g. S2145-S2148).
contentPagesstring|nullCREC content page range.
crecVolumestring|nullCongressional Record volume number.
crecNumberstring|nullCongressional Record issue number.
congressNumberintegerCongress number (e.g. 119).
seqinteger|nullSequence position within the topic group.
groupCountinteger|nullTotal statements in the topic group.
topicGroupIdstring|nullIdentifier for the topic group. Use to fetch all related statements.
audioUrlstring|nullDirect URL to the audio recording (MP3).
audioDurationMsinteger|nullAudio duration in milliseconds.
videoClipUrlstring|nullDirect URL to the extracted video clip.
videoThumbnailUrlstring|nullVideo clip thumbnail image URL.
videoUrlstring|nullFull session video URL (e.g. YouTube).
videoStartTimestampinteger|nullStart timestamp (seconds) within the session video.
legislationarray|nullReferenced legislation identifiers (e.g. ["H.R. 3684"]).
sourcePdfUrlsarray|nullURLs to the original Congressional Record PDF pages.
artifactsarrayArray of artifact text strings associated with the statement.

Search-Only Fields

These fields appear only in /api/v1/search responses when using semantic mode:

Field Type Description
similarityfloatCosine similarity score (0–1). Higher = more relevant. Only present in semantic mode.
matchedChunkstringThe text passage from the statement that was most similar to the query. Only present in semantic mode.

Example Responses

Representative JSON responses from each endpoint so you know what to expect.

GET /api/v1/dates

JSON Response
[
  "2025-03-15",
  "2025-03-14",
  "2025-03-13",
  "2025-03-12",
  "2025-03-11"
]

GET /api/v1/statements?date=2025-03-15&chamber=Senate&limit=2

JSON Response
[
  {
    "id": "f1e2d3c4-9876-5432-abcd-fedcba987654",
    "name": "Sen. Patricia Moore",
    "chamber": "Senate",
    "date": "2025-03-15",
    "title": "HIGHER EDUCATION AFFORDABILITY ACT",
    "text": "Mr. President, I rise today to address the growing crisis...",
    "deliveryType": "spoken",
    "statementOrigin": "floor_speech",
    "wordCount": 891,
    "politicalParty": "Democrat",
    "state": "Virginia",
    "district": null,
    "congressNumber": 119,
    "seq": 1,
    "groupCount": 5,
    "topicGroupId": "a1b2c3d4-5678-9abc-def0-123456789abc",
    "audioUrl": "https://storage.example.com/audio/f1e2d3c4.mp3",
    "audioDurationMs": 245000,
    "videoClipUrl": "https://storage.example.com/video/f1e2d3c4.mp4",
    "videoThumbnailUrl": "https://storage.example.com/thumb/f1e2d3c4.jpg",
    "videoUrl": "https://www.youtube.com/watch?v=example",
    "videoStartTimestamp": 3420,
    "legislation": ["S. 1025"],
    "sourcePdfUrls": ["https://www.govinfo.gov/content/pkg/CREC-2025-03-15/pdf/..."],
    "artifacts": []
  },
  {
    "id": "e2d3c4b5-8765-4321-bcde-edcba9876543",
    "name": "Sen. Robert Jackson",
    "chamber": "Senate",
    "date": "2025-03-15",
    "title": "HIGHER EDUCATION AFFORDABILITY ACT",
    "text": "I thank the senior Senator from Virginia for her remarks...",
    "deliveryType": "spoken",
    "statementOrigin": "floor_speech",
    "wordCount": 612,
    "politicalParty": "Republican",
    "state": "Texas",
    "district": null,
    "congressNumber": 119,
    "seq": 2,
    "groupCount": 5,
    "topicGroupId": "a1b2c3d4-5678-9abc-def0-123456789abc",
    "audioUrl": "https://storage.example.com/audio/e2d3c4b5.mp3",
    "audioDurationMs": 182000,
    "videoClipUrl": null,
    "videoThumbnailUrl": null,
    "videoUrl": null,
    "videoStartTimestamp": null,
    "legislation": ["S. 1025"],
    "sourcePdfUrls": null,
    "artifacts": []
  }
]

GET /api/v1/browse/2025-03-15

JSON Response (truncated)
{
  "Extensions of Remarks": {
    "RECOGNIZING NATIONAL SCIENCE WEEK": [
      { "id": "...", "name": "Rep. Amy Lee", "seq": 1, "chamber": "Extensions of Remarks", ... }
    ]
  },
  "House Spoken Remarks": {
    "PROVIDING FOR CONSIDERATION OF H.R. 1234": [
      { "id": "...", "name": "Rep. Maria Torres", "seq": 1, "chamber": "House", ... },
      { "id": "...", "name": "Rep. James Chen", "seq": 2, "chamber": "House", ... }
    ],
    "INFRASTRUCTURE INVESTMENT ACT": [
      { "id": "...", "name": "Rep. Jim Brown", "seq": 1, "chamber": "House", ... }
    ]
  },
  "Senate Spoken Remarks": {
    "HIGHER EDUCATION AFFORDABILITY ACT": [
      { "id": "...", "name": "Sen. Patricia Moore", "seq": 1, "chamber": "Senate", ... },
      { "id": "...", "name": "Sen. Robert Jackson", "seq": 2, "chamber": "Senate", ... }
    ]
  }
}

GET /api/v1/search?mode=keyword&q=tariff&chamber=House&pageSize=2

JSON Response (keyword)
{
  "results": [
    {
      "id": "c4d5e6f7-1234-5678-abcd-123456789abc",
      "name": "Rep. Kevin Walsh",
      "chamber": "House",
      "date": "2025-02-20",
      "title": "TRADE AND TARIFF REFORM ACT",
      "text": "The impact of these tariffs on American manufacturing cannot be overstated...",
      "wordCount": 612,
      "politicalParty": "Republican",
      "state": "Ohio",
      "topicGroupId": "d4e5f6a7-3456-7890-cdef-456789abcdef"
    }
  ],
  "totalCount": 84,
  "page": 1,
  "pageSize": 2,
  "totalPages": 42
}

GET /api/v1/search?mode=semantic&q=student+loan+forgiveness&pageSize=2

JSON Response (semantic)
{
  "results": [
    {
      "id": "d5e6f7a8-2345-6789-bcde-23456789abcd",
      "name": "Sen. Patricia Moore",
      "chamber": "Senate",
      "date": "2025-03-10",
      "title": "HIGHER EDUCATION AFFORDABILITY ACT",
      "text": "The question before us is whether the federal government should...",
      "wordCount": 891,
      "politicalParty": "Democrat",
      "state": "Virginia",
      "similarity": 0.87,
      "matchedChunk": "The burden of student loan debt affects over 43 million Americans. Proponents argue that forgiveness stimulates economic growth and enables home ownership."
    },
    {
      "id": "e6f7a8b9-3456-789a-cdef-3456789abcde",
      "name": "Sen. Robert Jackson",
      "chamber": "Senate",
      "date": "2025-03-10",
      "title": "STUDENT LOAN REFORM",
      "text": "We must weigh the cost to taxpayers against the economic benefit...",
      "wordCount": 734,
      "politicalParty": "Republican",
      "state": "Texas",
      "similarity": 0.82,
      "matchedChunk": "We must weigh the cost to taxpayers against the economic benefit of freeing an entire generation from crushing debt that prevents them from starting families."
    }
  ],
  "totalCount": 42,
  "page": 1,
  "pageSize": 2,
  "totalPages": 21
}

Code Examples

Complete, ready-to-run examples in popular languages.

Keyword Search with Pagination

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Paginated keyword search
def search_statements(query, page=1, page_size=50):
    resp = requests.get(f"{BASE}/api/v1/search", headers=HEADERS, params={
        "mode": "keyword",
        "q": query,
        "page": page,
        "pageSize": page_size,
    })
    resp.raise_for_status()
    return resp.json()

# Fetch all pages for "climate change"
data = search_statements("climate change")
all_results = data["results"]

while data["page"] < data["totalPages"]:
    data = search_statements("climate change", page=data["page"] + 1)
    all_results.extend(data["results"])

print(f"Found {len(all_results)} total statements")

Semantic Search with Filters

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Semantic search — find conceptually similar statements
resp = requests.get(f"{BASE}/api/v1/search", headers=HEADERS, params={
    "mode": "semantic",
    "q": "arguments for and against federal student loan forgiveness",
    "chamber": "Senate",
    "dateFrom": "2025-01-01",
    "pageSize": 10,
})
resp.raise_for_status()
results = resp.json()["results"]

for r in results:
    print(f"[{r['similarity']:.2f}] {r['name']} — {r['title']}")
    print(f"  Matched: {r['matchedChunk'][:120]}...")
    print()

Download Full Day's Record

Python
import requests, json

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Get available dates
dates = requests.get(f"{BASE}/api/v1/dates", headers=HEADERS).json()
print(f"Available: {len(dates)} dates, latest: {dates[0]}")

# Browse the most recent date
latest = dates[0]
record = requests.get(f"{BASE}/api/v1/browse/{latest}", headers=HEADERS).json()

# Print summary
for category, topics in record.items():
    stmt_count = sum(len(stmts) for stmts in topics.values())
    print(f"\n{category}: {len(topics)} topics, {stmt_count} statements")
    for title, stmts in list(topics.items())[:3]:
        speakers = ", ".join(s["name"] for s in stmts if s.get("name"))
        print(f"  • {title} ({len(stmts)} statements) — {speakers}")

Get Statements by Date and Chamber

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Fetch Senate statements for a specific date
resp = requests.get(f"{BASE}/api/v1/statements", headers=HEADERS, params={
    "date": "2025-03-15",
    "chamber": "Senate",
    "limit": 200,
})
resp.raise_for_status()
statements = resp.json()

print(f"{len(statements)} Senate statements on 2025-03-15")
for s in statements[:10]:
    print(f"  {s['name']} — {s['title'][:60]}")

Filter Search by State

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# Search for Texas representatives discussing border policy
resp = requests.get(f"{BASE}/api/v1/search", headers=HEADERS, params={
    "mode": "keyword",
    "q": "border security",
    "states": "Texas",
    "chamber": "House",
    "pageSize": 25,
})
resp.raise_for_status()
data = resp.json()

print(f"{data['totalCount']} results from Texas House members")
for r in data["results"]:
    print(f"  {r['date']} | {r['name']} ({r.get('district', 'N/A')})")
    print(f"    {r['title'][:80]}")

Compare Statements Across Chambers

Python
import requests

API_KEY = "YOUR_API_KEY"
BASE    = "https://crec-website-be.onrender.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

query = "artificial intelligence"

for chamber in ["House", "Senate"]:
    resp = requests.get(f"{BASE}/api/v1/search", headers=HEADERS, params={
        "mode": "keyword",
        "q": query,
        "chamber": chamber,
        "dateFrom": "2025-01-01",
        "pageSize": 1,
    })
    resp.raise_for_status()
    data = resp.json()
    print(f"{chamber}: {data['totalCount']} statements about '{query}'")

Keyword Search with Fetch API

JavaScript (Node.js / Browser)
const API_KEY = "YOUR_API_KEY";
const BASE = "https://crec-website-be.onrender.com";

async function searchStatements(query, options = {}) {
  const params = new URLSearchParams({
    mode: options.mode || "keyword",
    q: query,
    page: String(options.page || 1),
    pageSize: String(options.pageSize || 50),
  });

  if (options.chamber) params.set("chamber", options.chamber);
  if (options.dateFrom) params.set("dateFrom", options.dateFrom);
  if (options.dateTo) params.set("dateTo", options.dateTo);
  if (options.states) params.set("states", options.states);

  const res = await fetch(`${BASE}/api/v1/search?${params}`, {
    headers: { Authorization: `Bearer ${API_KEY}` },
  });

  if (!res.ok) {
    const err = await res.json();
    throw new Error(`API error ${res.status}: ${err.detail}`);
  }

  return res.json();
}

// Usage
const data = await searchStatements("healthcare reform", {
  chamber: "Senate",
  dateFrom: "2025-06-01",
  pageSize: 20,
});

console.log(`Found ${data.totalCount} results`);
data.results.forEach((s) => {
  console.log(`${s.date} | ${s.name} | ${s.title}`);
});

Browse All Dates and the Latest Record

JavaScript
const API_KEY = "YOUR_API_KEY";
const BASE = "https://crec-website-be.onrender.com";
const headers = { Authorization: `Bearer ${API_KEY}` };

// Fetch all dates, then browse the latest
const dates = await fetch(`${BASE}/api/v1/dates`, { headers }).then(r => r.json());
console.log(`${dates.length} dates available`);

const browse = await fetch(`${BASE}/api/v1/browse/${dates[0]}`, { headers })
  .then(r => r.json());

for (const [category, topics] of Object.entries(browse)) {
  const count = Object.values(topics).flat().length;
  console.log(`${category}: ${Object.keys(topics).length} topics (${count} statements)`);
}

Get Statements for a Date

JavaScript
const API_KEY = "YOUR_API_KEY";
const BASE = "https://crec-website-be.onrender.com";
const headers = { Authorization: `Bearer ${API_KEY}` };

const params = new URLSearchParams({
  date: "2025-03-15",
  chamber: "House",
  limit: "100",
});

const statements = await fetch(`${BASE}/api/v1/statements?${params}`, { headers })
  .then(r => r.json());

console.log(`${statements.length} House statements on 2025-03-15`);
statements.slice(0, 5).forEach(s => {
  console.log(`  ${s.name} — ${s.title}`);
});

Semantic Search with Date Range

JavaScript
const API_KEY = "YOUR_API_KEY";
const BASE = "https://crec-website-be.onrender.com";
const headers = { Authorization: `Bearer ${API_KEY}` };

const params = new URLSearchParams({
  mode: "semantic",
  q: "impact of tariffs on American farmers",
  dateFrom: "2025-01-01",
  dateTo: "2025-06-30",
  pageSize: "10",
});

const data = await fetch(`${BASE}/api/v1/search?${params}`, { headers })
  .then(r => r.json());

data.results.forEach(r => {
  console.log(`[${r.similarity.toFixed(2)}] ${r.name} — ${r.title}`);
  console.log(`  ${r.matchedChunk.slice(0, 120)}...\n`);
});

Search and Analyze with R

R
library(httr2)
library(jsonlite)
library(dplyr)

api_key <- "YOUR_API_KEY"
base_url <- "https://crec-website-be.onrender.com"

# Search for statements about immigration
resp <- request(base_url) |>
  req_url_path_append("api", "v1", "search") |>
  req_url_query(
    mode = "keyword",
    q = "immigration reform",
    pageSize = 100,
    chamber = "Senate"
  ) |>
  req_headers(Authorization = paste("Bearer", api_key)) |>
  req_perform()

data <- resp_body_json(resp)
statements <- bind_rows(data$results)

# Analyze by party
statements |>
  count(politicalParty, sort = TRUE) |>
  print()

# Analyze by state
statements |>
  filter(!is.na(state)) |>
  count(state, sort = TRUE) |>
  head(10) |>
  print()

Build a Time Series Dataset

R
library(httr2)
library(jsonlite)
library(dplyr)
library(lubridate)

api_key <- "YOUR_API_KEY"
base_url <- "https://crec-website-be.onrender.com"

# Get all available dates
dates_resp <- request(base_url) |>
  req_url_path_append("api", "v1", "dates") |>
  req_headers(Authorization = paste("Bearer", api_key)) |>
  req_perform()

dates <- resp_body_json(dates_resp)

# Fetch statements per day and count by chamber
daily_stats <- lapply(dates[1:30], function(d) {
  resp <- request(base_url) |>
    req_url_path_append("api", "v1", "statements") |>
    req_url_query(date = d, limit = 1000) |>
    req_headers(Authorization = paste("Bearer", api_key)) |>
    req_perform()

  stmts <- resp_body_json(resp)
  tibble(
    date = as.Date(d),
    total = length(stmts),
    house = sum(sapply(stmts, \(s) s$chamber == "House")),
    senate = sum(sapply(stmts, \(s) s$chamber == "Senate"))
  )
}) |> bind_rows()

print(daily_stats)

Quick Keyword Search

bash
# Keyword search for "tariff" in the House
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/search?\
mode=keyword&q=tariff&chamber=House&pageSize=5" | jq '.results[] | {name, date, title}'

Semantic Search

bash
# Semantic search — natural language query
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/search?\
mode=semantic&q=debate+about+TikTok+ban+and+national+security&\
pageSize=5" | jq '.results[] | {similarity, name, title, matchedChunk}'

List Dates and Browse

bash
# Get all available dates
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/dates" | jq '.[0:5]'

# Browse a specific date (grouped by category)
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/browse/2025-03-15" | jq 'keys'

Get Statements for a Date and Chamber

bash
# Fetch Senate statements for a specific date
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/statements?\
date=2025-03-15&chamber=Senate&limit=10" | jq '.[].name'

Filter by State

bash
# Search for statements by California representatives
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://crec-website-be.onrender.com/api/v1/search?\
mode=keyword&q=wildfire&states=California&pageSize=10" \
  | jq '.results[] | {name, date, state, title}'

Paginate Through All Results

bash
# Loop through all pages of results
PAGE=1
TOTAL_PAGES=1
while [ $PAGE -le $TOTAL_PAGES ]; do
  RESPONSE=$(curl -s -H "Authorization: Bearer YOUR_API_KEY" \
    "https://crec-website-be.onrender.com/api/v1/search?\
mode=keyword&q=healthcare&page=$PAGE&pageSize=100")

  TOTAL_PAGES=$(echo "$RESPONSE" | jq '.totalPages')
  COUNT=$(echo "$RESPONSE" | jq '.results | length')
  echo "Page $PAGE/$TOTAL_PAGES: $COUNT results"
  PAGE=$((PAGE + 1))
done