{
  "info": {
    "name": "BillOdds API v1",
    "description": "Calibrated passage probabilities for gaming, sports-betting and prediction-market legislation.\n\n**Auth:** every request sends `Authorization: Bearer {{api_key}}` (set `api_key` in the collection variables — keys look like `bo_live_...`). Your key's scopes (states, sectors, endpoints, history depth) decide what you can see; out-of-scope requests return 403 with an explanation.\n\n**Conventions:** JSON only · timestamps UTC ISO-8601 · every list response carries `as_of` · errors use `{\"error\":{\"code\",\"message\"}}` · 429 includes `Retry-After` · rate limits are per-key and approximate.\n\nDocs: https://billodds.com/developers · Keys: hello@billodds.com · Attribution required: \"Data: BillOdds.com\"",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{api_key}}", "type": "string" }]
  },
  "variable": [
    { "key": "base_url", "value": "https://billodds.com/api/v1" },
    { "key": "api_key", "value": "bo_live_PASTE_YOUR_KEY_HERE" },
    { "key": "state", "value": "ok" },
    { "key": "bill", "value": "hb1047" }
  ],
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "pm.test('status is not a server error', () => pm.expect(pm.response.code).to.be.below(500));",
          "if (pm.response.code === 200) {",
          "  pm.test('response is JSON', () => pm.response.to.be.json);",
          "}"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "Meta",
      "item": [
        {
          "name": "API status & model info",
          "request": {
            "method": "GET",
            "url": { "raw": "{{base_url}}/meta", "host": ["{{base_url}}"], "path": ["meta"] },
            "description": "Model version, calibration stats (Brier), bill count, last heartbeat. Use this to monitor BillOdds itself and to verify your key works."
          }
        }
      ]
    },
    {
      "name": "Bills",
      "item": [
        {
          "name": "List bills (screener)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/bills?sector=sports_betting&sort=p_pass&per_page=25&page=1",
              "host": ["{{base_url}}"],
              "path": ["bills"],
              "query": [
                { "key": "state", "value": "pa", "description": "Two-letter jurisdiction (us = Congress)", "disabled": true },
                { "key": "sector", "value": "sports_betting", "description": "sports_betting | prediction_markets | igaming | sweepstakes | skill_games" },
                { "key": "status", "value": "in_committee", "description": "Filter by legislative status", "disabled": true },
                { "key": "chamber", "value": "house", "disabled": true },
                { "key": "p_min", "value": "0.5", "description": "Minimum passage probability (0–1)", "disabled": true },
                { "key": "p_max", "value": "0.9", "disabled": true },
                { "key": "updated_since", "value": "2026-10-01T00:00:00Z", "description": "Only bills updated after this instant", "disabled": true },
                { "key": "sort", "value": "p_pass", "description": "p_pass | updated_at | bill_number" },
                { "key": "page", "value": "1" },
                { "key": "per_page", "value": "25", "description": "max 100" }
              ]
            },
            "description": "Filterable, sortable, paginated list of tracked bills with current probability and deltas. `total` counts only bills your key's scopes allow."
          }
        },
        {
          "name": "Bill detail",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/bills/{{state}}/{{bill}}",
              "host": ["{{base_url}}"],
              "path": ["bills", "{{state}}", "{{bill}}"],
              "query": [
                { "key": "session_id", "value": "", "description": "Pin to a specific session when a bill number repeats across sessions", "disabled": true }
              ]
            },
            "description": "Full payload for one bill: current p_pass, ranked factor contributions, AI summary (with disclosure), Who's Affected tiers, sponsors, status history, fiscal note link. History length honors your key's history_days."
          }
        }
      ]
    },
    {
      "name": "Tape",
      "item": [
        {
          "name": "Probability history",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/tape/{{state}}/{{bill}}",
              "host": ["{{base_url}}"],
              "path": ["tape", "{{state}}", "{{bill}}"],
              "query": [
                { "key": "from", "value": "2026-09-01T00:00:00Z", "description": "Range start (ISO-8601)", "disabled": true },
                { "key": "to", "value": "2026-10-13T00:00:00Z", "description": "Range end", "disabled": true }
              ]
            },
            "description": "The full probability time series for one bill — every event-triggered point plus daily marks, matching the site chart exactly. Requests wholly outside your key's history window return 403 `history_not_in_plan`."
          }
        }
      ]
    },
    {
      "name": "Changes (the feed)",
      "item": [
        {
          "name": "Poll changes since cursor",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/changes?since=2026-10-12T00:00:00Z",
              "host": ["{{base_url}}"],
              "path": ["changes"],
              "query": [
                { "key": "since", "value": "2026-10-12T00:00:00Z", "description": "Cursor: echo back next_since from the previous response" },
                { "key": "types", "value": "probability,status", "description": "probability | status | event (comma-separated)", "disabled": true },
                { "key": "state", "value": "us", "disabled": true },
                { "key": "sector", "value": "prediction_markets", "disabled": true },
                { "key": "limit", "value": "100", "disabled": true }
              ]
            },
            "description": "The integration primitive: every probability move, status change and event since your cursor, with old/new values. Stateless polling — store `next_since`, send it back next poll. Ordered by insertion time with a 120s holdback so nothing is skipped; one request scans at most 7 days, `has_more` tells you to keep paging."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200) {",
                  "  const b = pm.response.json();",
                  "  if (b.next_since) pm.collectionVariables.set('last_cursor', b.next_since);",
                  "  pm.test('has next_since cursor', () => pm.expect(b.next_since).to.be.a('string'));",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Reference (ships with #98/#99)",
      "description": "These endpoints are specified and land with the final m7-api PRs: /movers, /sectors, /sectors/{slug}, /events, /sessions. Requests here will 404 until that merge.",
      "item": [
        { "name": "Movers", "request": { "method": "GET", "url": { "raw": "{{base_url}}/movers?window=7d&direction=up", "host": ["{{base_url}}"], "path": ["movers"], "query": [ { "key": "window", "value": "7d" }, { "key": "direction", "value": "up" } ] } } },
        { "name": "Sectors", "request": { "method": "GET", "url": { "raw": "{{base_url}}/sectors", "host": ["{{base_url}}"], "path": ["sectors"] } } },
        { "name": "Sector detail", "request": { "method": "GET", "url": { "raw": "{{base_url}}/sectors/sports-betting", "host": ["{{base_url}}"], "path": ["sectors", "sports-betting"] } } },
        { "name": "Events (calendar)", "request": { "method": "GET", "url": { "raw": "{{base_url}}/events?from=2026-10-13&type=hearing", "host": ["{{base_url}}"], "path": ["events"], "query": [ { "key": "from", "value": "2026-10-13" }, { "key": "type", "value": "hearing" } ] } } },
        { "name": "Sessions (legislative calendar)", "request": { "method": "GET", "url": { "raw": "{{base_url}}/sessions", "host": ["{{base_url}}"], "path": ["sessions"] } } }
      ]
    }
  ]
}
