{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending & Grants.gov API (Unofficial)",
    "description": "Federal contract, IDV and grant awards from USAspending.gov plus posted and forecasted Grants.gov opportunities in one schema. Filter by agency, NAICS, state, keyword and Assistance Listing. Organisation recipients only, awards from April 4, 2022. Not affiliated with any US government agency.",
    "version": "0.1",
    "x-build-id": "Rwn6VE6caVcBSfwPi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/graylabs~federal-awards-grants/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-graylabs-federal-awards-grants",
        "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/graylabs~federal-awards-grants/runs": {
      "post": {
        "operationId": "runs-sync-graylabs-federal-awards-grants",
        "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/graylabs~federal-awards-grants/run-sync": {
      "post": {
        "operationId": "run-sync-graylabs-federal-awards-grants",
        "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": {
          "includeAwards": {
            "title": "USAspending.gov awards",
            "type": "boolean",
            "description": "Include federal contract, IDV and grant awards from USAspending.gov. Awards to individuals and sole proprietorships are never included.",
            "default": true
          },
          "includeOpportunities": {
            "title": "Grants.gov opportunities",
            "type": "boolean",
            "description": "Include posted and forecasted funding opportunities from Grants.gov.",
            "default": true
          },
          "awardCategories": {
            "title": "Award categories",
            "type": "array",
            "description": "Which USAspending award types to include. contracts = definitive contracts, purchase orders, delivery and task orders; idvs = indefinite delivery vehicles (GWACs, BPAs, IDIQs); grants = block, formula and project grants and cooperative agreements.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants"
              ],
              "enumTitles": [
                "Contracts",
                "IDVs (indefinite delivery vehicles)",
                "Grants and cooperative agreements"
              ]
            },
            "default": [
              "contracts",
              "grants"
            ]
          },
          "awardDateType": {
            "title": "Which dates to search",
            "enum": [
              "new",
              "modified"
            ],
            "type": "string",
            "description": "new = awards whose first (base) obligation falls in the window. modified = awards last changed in the window (includes modifications to older awards).",
            "default": "new"
          },
          "awardsLastNDays": {
            "title": "Awards from the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Window ending today. Ignored when you set a start date. Agencies report grants with a delay of a few weeks, so short windows can return few grants.",
            "default": 30
          },
          "awardsStartDate": {
            "title": "Awards start date",
            "type": "string",
            "description": "Optional, YYYY-MM-DD. Overrides \"last N days\". The earliest date returned is 2022-04-04 (see README)."
          },
          "awardsEndDate": {
            "title": "Awards end date",
            "type": "string",
            "description": "Optional, YYYY-MM-DD. Defaults to today."
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Exact top-tier agency names as shown on USAspending.gov, e.g. \"Department of Energy\". Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "recipientSearch": {
            "title": "Recipient search",
            "type": "array",
            "description": "Text matched against recipient organisation names and UEIs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes (contracts and IDVs)",
            "type": "array",
            "description": "2 to 6 digit NAICS codes, e.g. 541512. Applies to contracts and IDVs only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter US state codes, e.g. CA, TX.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAwardAmount": {
            "title": "Minimum award amount",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with at least this amount (US dollars)."
          },
          "keywords": {
            "title": "Keywords (both sources)",
            "type": "array",
            "description": "Free-text keywords. USAspending matches any of them; Grants.gov is searched once per keyword.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "assistanceListings": {
            "title": "Assistance Listing numbers (grants)",
            "type": "array",
            "description": "Assistance Listing (formerly CFDA) numbers such as 93.213. Filters USAspending grants and Grants.gov opportunities.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "opportunityStatuses": {
            "title": "Opportunity statuses",
            "type": "array",
            "description": "Grants.gov opportunity statuses to include.",
            "items": {
              "type": "string",
              "enum": [
                "posted",
                "forecasted",
                "closed",
                "archived"
              ],
              "enumTitles": [
                "Posted",
                "Forecasted",
                "Closed",
                "Archived"
              ]
            },
            "default": [
              "posted",
              "forecasted"
            ]
          },
          "opportunitiesPostedLastNDays": {
            "title": "Opportunities posted in the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "0 = no date limit (all opportunities with the chosen statuses, newest first).",
            "default": 0
          },
          "grantsGovAgencyCodes": {
            "title": "Grants.gov agency codes",
            "type": "array",
            "description": "Grants.gov agency codes, e.g. HHS, HHS-NIH11, DOE, USDA-NIFA.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fundingCategories": {
            "title": "Funding categories",
            "type": "array",
            "description": "Grants.gov funding activity category codes, e.g. HL (Health), ST (Science and Technology), ED (Education), AG (Agriculture).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "eligibilityCodes": {
            "title": "Eligible applicant codes",
            "type": "array",
            "description": "Grants.gov eligibility codes, e.g. 20 (private institutions of higher education), 23 (small businesses), 12 (nonprofits with 501(c)(3)).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeOpportunityDetails": {
            "title": "Include opportunity details",
            "type": "boolean",
            "description": "Adds the synopsis text, award ceiling and floor, estimated funding, expected number of awards, eligibility and funding instruments. Makes one extra request per opportunity.",
            "default": true
          },
          "maxRecords": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum rows to save across both sources. Split evenly across the selected sources and award categories; unused room passes to the next one.",
            "default": 1000
          },
          "maxRequests": {
            "title": "Maximum API requests",
            "minimum": 5,
            "maximum": 20000,
            "type": "integer",
            "description": "Safety cap on API calls per run, retries included.",
            "default": 1500
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}