Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

analytics.usa.gov

The analytics.usa.gov API

In addition to being published and available for download, the data generated for this site is also available via an API.

Please note we have recently updated to v1.1, please update your requests accordingly.

The URL for the API is https://api.gsa.gov/analytics/dap/v1.1, and it exposes 3 routes to query data:

API Keys

To use the API, please register for an API key below and include it in your query in this fashion:

Loading signup form...

The Response

The response represents the rows in the data array in the JSON reports that can be downloaded, or the rows in the CSV files that can be downloaded. They are returned as an array of JSON objects. Here is an example of one such object:

{
  "id": 60716,
  "report_name": "today",
  "report_agency": "justice",
  "date_time": "2017-04-07T14:00:00.000Z",
  "data": {
    "visits": "4240"
  },
  "created_at": "2017-04-07T04:23:55.792Z",
  "updated_at": "2017-04-07T04:23:55.792Z"
}

Note that is has the following properties:

Querying reports

Reports can be queried by substituting <report name> in the path with the name of the report.

The following reports can be queried using the API:

Filtering based on agencies

Reports can be queried by substituting <agency name> in the path with the name of the agency. If the path without an agency name parameter is used, the reports correspond to government wide data.

The list of valid agency names includes:

Filtering by domain

For the site, domain, download, and second-level-domain reports you may use the domain route, to only return results by domain.

Query params

The following query params are supported to work with the data:

analytics.usa.gov

Analytics.usa.gov is a product of GSA’s Digital Analytics Program.

Looking for U.S. government information and services?
Visit USA.gov