{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contracts, Grants & Lobbying API",
    "description": "Four federal money sources in one dataset: SAM.gov opportunities with contracting-officer contacts (free SAM.gov key), Grants.gov notices with award ceilings, USAspending awards and sub-awards, Senate LDA lobbying filings. Filter by keyword, agency, NAICS, set-aside, state. Three need no API key.",
    "version": "0.1",
    "x-build-id": "iE6u9D1m6iEuL7gfd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~federal-contracts-grants-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-federal-contracts-grants-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/insight.solutions~federal-contracts-grants-api/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-federal-contracts-grants-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/insight.solutions~federal-contracts-grants-api/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-federal-contracts-grants-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which federal systems to read. `grants` (Grants.gov funding notices) and `awards` (USAspending prime awards) need no key at all. `opportunities` reads SAM.gov contract opportunities through the official Get Opportunities API and needs your own free `samApiKey`. `lobbying` reads Senate LDA filings. All four produce the same columns, so a run over several of them is one table.",
            "items": {
              "type": "string",
              "enum": [
                "opportunities",
                "grants",
                "awards",
                "lobbying"
              ],
              "enumTitles": [
                "SAM.gov contract opportunities (needs your free API key)",
                "Grants.gov funding opportunities",
                "USAspending awards and sub-awards",
                "Senate LDA lobbying filings"
              ]
            },
            "default": [
              "grants",
              "awards"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text search, applied per source: SAM.gov searches notice titles, Grants.gov searches the full notice, USAspending searches award text, and the Senate LDA searches the lobbying-issue descriptions. Several words are joined with spaces. Leave empty to take everything the other filters allow.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "grantStatuses": {
            "title": "Grant statuses",
            "type": "array",
            "description": "Which Grants.gov statuses to search. `closed` and `archived` reach historical notices going back to at least 2015; `posted` and `forecasted` are the roughly 1,200 opportunities open at any time.",
            "items": {
              "type": "string",
              "enum": [
                "posted",
                "forecasted",
                "closed",
                "archived"
              ],
              "enumTitles": [
                "Posted",
                "Forecasted",
                "Closed",
                "Archived"
              ]
            },
            "default": [
              "posted",
              "forecasted"
            ]
          },
          "awardTypes": {
            "title": "Award types (USAspending)",
            "type": "array",
            "description": "Which USAspending award categories to search. USAspending requires at least one, so leaving this empty means contracts.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "directPayments",
                "loans",
                "other"
              ],
              "enumTitles": [
                "Contracts",
                "IDVs (indefinite delivery vehicles)",
                "Grants",
                "Direct payments",
                "Loans",
                "Other"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "maxResults": {
            "title": "Max results per source",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "How many paid rows each selected source may return. `0` means no cap. A four-source run at the default therefore tops out at 800 paid rows.",
            "default": 200
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Your own free SAM.gov Public API Key, required only for the `opportunities` source. Get one at sam.gov → sign in → Account Details → **Request Public API Key**. A personal (non-federal) key allows 10 requests per day, and each request returns up to 1,000 notices. The key is sent to api.sam.gov in an `X-Api-Key` header and is never written to a row, a log line or a result URL. Leave empty and the `opportunities` source is skipped with a free diagnostic row explaining this."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "ISO date, e.g. `2026-01-01`. Applied per source: SAM.gov posted date (the API requires a window and defaults to the last 30 days), Grants.gov open/close dates, USAspending action period (its own earliest date is 2007-10-01) and the LDA posting date.",
            "default": ""
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "ISO date, e.g. `2026-09-30`. Defaults to today. SAM.gov accepts a window of at most one year; a wider range is clamped to the most recent year and a free diagnostic row says so.",
            "default": ""
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Agency names or abbreviations, e.g. `[\"Department of Defense\"]` or `[\"DOD\"]`. Resolved per source: USAspending matches them against its published top-tier agency list, Grants.gov against the agency codes in the result set, SAM.gov against the notice's own organisation path, and the LDA against the government entities named on the filing. A name that cannot be resolved gets a free diagnostic row and the run continues.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter state codes, e.g. `[\"VA\", \"TX\"]`. Matched against the place of performance on opportunities and awards, and against the client's state on lobbying filings.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Six-digit NAICS codes or prefixes, e.g. `[\"541512\"]` or `[\"5415\"]`. Used by SAM.gov and USAspending; Grants.gov and the LDA have no NAICS field and are unaffected.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product or Service Codes, e.g. `[\"D302\"]`. Sent to SAM.gov as a filter; on USAspending awards the code is matched on the returned rows instead, because the endpoint's PSC filter takes code *paths* rather than flat codes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only records worth at least this much: the award amount on USAspending, the award ceiling on Grants.gov, and the income or expenses reported on a lobbying filing. Leave empty for no minimum."
          },
          "setAsides": {
            "title": "Set-asides",
            "type": "array",
            "description": "SAM.gov set-aside codes, e.g. `[\"SBA\"]` (total small business), `[\"8A\"]`, `[\"HZC\"]`, `[\"SDVOSBC\"]`, `[\"WOSB\"]`, `[\"EDWOSB\"]`. Setting this switches the `opportunities` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types (SAM.gov)",
            "type": "array",
            "description": "Which kinds of SAM.gov notice to return. Leave empty for all of them. Setting this switches the `opportunities` source on.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "s",
                "a",
                "g",
                "i"
              ],
              "enumTitles": [
                "Solicitation",
                "Combined Synopsis/Solicitation",
                "Presolicitation",
                "Sources Sought",
                "Special Notice",
                "Award Notice",
                "Sale of Surplus Property",
                "Intent to Bundle Requirements"
              ]
            },
            "default": []
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "description": "Recipient names to search for on USAspending, e.g. `[\"Lockheed Martin\"]`. Partial matches. Setting this switches the `awards` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lobbyingClients": {
            "title": "Lobbying clients",
            "type": "array",
            "description": "Client names on Senate LDA filings, e.g. `[\"Amazon\"]`. Partial match. Setting this switches the `lobbying` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lobbyingRegistrants": {
            "title": "Lobbying registrants",
            "type": "array",
            "description": "Registrant (lobbying firm) names, e.g. `[\"Akin Gump\"]`. Partial match. Setting this switches the `lobbying` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lobbyingIssues": {
            "title": "Lobbying issue codes",
            "type": "array",
            "description": "Senate LDA general issue codes, e.g. `[\"SCI\"]` (science/technology), `[\"TAX\"]`, `[\"DEF\"]`. Validated against the LDA's own published list; an unknown code gets a free diagnostic row naming where the valid ones live.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filingYear": {
            "title": "Filing year (LDA)",
            "minimum": 1998,
            "maximum": 2100,
            "type": "integer",
            "description": "Which year of Senate LDA filings to read. Defaults to the current year when the `lobbying` source runs."
          },
          "activeOnly": {
            "title": "Active notices only",
            "type": "boolean",
            "description": "Keep only SAM.gov notices the system still reports as active. Turn it off to reach archived notices inside the date window.",
            "default": true
          },
          "fundingCategories": {
            "title": "Funding categories (Grants.gov)",
            "type": "array",
            "description": "Grants.gov funding-category codes, e.g. `[\"HL\"]` (health), `[\"ST\"]` (science and technology), `[\"AG\"]` (agriculture). Setting this switches the `grants` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "eligibilities": {
            "title": "Eligibilities (Grants.gov)",
            "type": "array",
            "description": "Grants.gov applicant-eligibility codes, e.g. `[\"02\"]` (city or township governments), `[\"25\"]` (others). Setting this switches the `grants` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fundingInstruments": {
            "title": "Funding instruments (Grants.gov)",
            "type": "array",
            "description": "Grants.gov funding-instrument codes: `G` grant, `CA` cooperative agreement, `PC` procurement contract, `O` other.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "alnCodes": {
            "title": "ALN / CFDA numbers",
            "type": "array",
            "description": "Assistance Listing Numbers, e.g. `[\"93.788\"]`. Sent to Grants.gov as its `cfda` parameter and to USAspending as `program_numbers`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lobbyingLobbyists": {
            "title": "Lobbyists",
            "type": "array",
            "description": "Named lobbyists to search for. Setting this switches the `lobbying` source on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "filingTypes": {
            "title": "Filing types (LDA)",
            "type": "array",
            "description": "LDA filing types, e.g. `[\"Q1\"]`…`[\"Q4\"]` (quarterly reports), `[\"RR\"]` (registration), `[\"MM\"]` (mid-year). The API takes one per request, so several types mean several requests against a 15-per-minute budget.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxAmount": {
            "title": "Maximum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "The other end of the same band. Leave empty for no maximum."
          },
          "includeDetails": {
            "title": "Fetch full details",
            "type": "boolean",
            "description": "Fetch the per-record detail: the Grants.gov synopsis with its award ceiling, eligibility text, agency contact and attachment list, and the USAspending award record with its sub-award totals, competition fields and period of performance. Inside the row price — it is not a separate charge. Turn it off for a faster, shallower run.",
            "default": true
          },
          "includeDescriptions": {
            "title": "Fetch SAM.gov descriptions",
            "type": "boolean",
            "description": "Fetch the full description text of each SAM.gov notice. Off by default because each description is a **whole extra request** against a personal key's 10-per-day allowance; at most 5 are fetched per run and the log says how many.",
            "default": false
          },
          "includeTransactions": {
            "title": "Include award transactions",
            "type": "boolean",
            "description": "Nest each USAspending award's transaction history on its row. Never billed separately.",
            "default": false
          },
          "includeSubawards": {
            "title": "Include sub-awards",
            "type": "boolean",
            "description": "Nest each USAspending award's sub-awards on its row. Never billed separately.",
            "default": false
          },
          "maxTransactionsPerAward": {
            "title": "Max transactions per award",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on the nested transaction list carried by each USAspending award row. The default of 50 covers most awards; raise it when you need a full modification history, or set 0 to skip the transaction fetch entirely.",
            "default": 50
          },
          "maxSubawardsPerAward": {
            "title": "Max sub-awards per award",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on the nested sub-award list carried by each USAspending award row. The default of 50 is enough for most prime awards; raise it for a large multi-tier contract, or set 0 to skip the sub-award fetch entirely.",
            "default": 50
          },
          "includeSummary": {
            "title": "Include free summary rows",
            "type": "boolean",
            "description": "Add free `summary` and `facet` rows: how many records each source matched in total, USAspending's award counts by category and its top ten agencies, recipients and NAICS codes by obligated dollars, and Grants.gov's own agency, category, eligibility and instrument facets. Never charged.",
            "default": true
          },
          "includeRawDescription": {
            "title": "Keep raw HTML descriptions",
            "type": "boolean",
            "description": "Keep the untouched HTML of a notice description in `descriptionHtml` alongside the plain-text `description`. Off by default because it is large.",
            "default": false
          },
          "incremental": {
            "title": "Incremental mode",
            "type": "boolean",
            "description": "Skip records this Actor has already returned, using a key-value store that outlives the run. Turns a daily job into a few new rows instead of a re-scrape. Note that ID de-duplication also suppresses a record that has since been *amended* — for modification tracking, run with this off and a rolling `dateFrom` window instead.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Which named key-value store holds the incremental cursor. Use different names for different saved searches so they do not hide each other's records.",
            "default": "federal-contracts-grants-state"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many sources and detail fetches run at once. The Senate LDA is always strictly serial, whatever this is set to, because its published limit is 15 requests a minute.",
            "default": 4
          },
          "maxRunSecs": {
            "title": "Time budget (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop fetching after this many seconds and keep everything already returned. USAspending queries have taken up to 15 seconds each, so raise this for large runs.",
            "default": 240
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "All four APIs answered from Apify's datacenter proxy and from no proxy at all in testing, so the cheap datacenter pool is the default and a cleared field still works.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}