USAspending API ReferenceIndependent
Try the API

Disaster Funding and Spending Download

POST/api/v2/download/disaster/

Creates a new download job for the requested COVID-19 related account and award. Returns a link to a zipped file containing the generated data files.

Request

curl -X POST 'https://api.usaspending.gov/api/v2/download/disaster/' \
  -H 'Content-Type: application/json' \
  -d '{
  "filters": {
    "def_codes": [
      "L",
      "M",
      "N",
      "O",
      "P",
      "U"
    ]
  }
}'

Request body

The filters object is shared by every search endpoint. The filter object explains each filter with examples.

  • filtersobject · Filters1 field
    • def_codesarray of DEFC

      List of Disaster Emergency Fund (DEF) Codes (DEFC) defined by legislation at the time of writing. Currently, the download is limited to either All COVID-19 DEFC or a single COVID-19 DEFC. A list of current DEFC can be found here.

      Default ["L", "M", "N", "O", "P", "U", "V"]

  • file_formatenum (string)

    The format of the file(s) in the zip file containing the data. Currently, only works for a download filtered on a single DEFC.

    Allowed values
    • csv
    • tsv
    • pstxt

    Default csv

Try it

Runs against the live API. Responses are real data.

POST/api/v2/download/disaster/

Response · 200

  • status_urlstringRequired

    The endpoint used to get the status of a download.

  • file_namestringRequired

    Is the name of the zipfile containing CSVs that will be generated (with a timestamp suffix).

  • file_urlstringRequired

    The URL for downloading the zip file containing the generated data files. It might not resolve to a file if the download is in-progress.

  • download_requestobjectRequired

    The JSON object used when processing the download.

Example response
{
  "status_url": "https://api.usaspending.gov/api/v2/download/status?file_name=COVID-19_Profile_2020-07-09_H17M39S27272793.zip",
  "file_name": "COVID-19_Profile_2020-07-09_H17M39S27272793.zip",
  "file_url": "https://files.usaspending.gov/generated_downloads/COVID-19_Profile_2020-07-09_H17M39S27272793.zip",
  "download_request": {
    "filters": {
      "def_codes": [
        "L"
      ],
      "latest_fiscal_period": "8",
      "latest_fiscal_year": "2020",
      "start_date": "2020-04-01"
    }
  }
}

Recent changes

Generated from contracts/v2/download/disaster.md in the USAspending API repo.

Loading…