Real time data is currently unavailable.
This API is under active development, and breaking changes may be made without warning. Have feedback or questions? Please let us know! Please note we have recently updated to `v1.1`, please update your requests accordingly.
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:
/reports/<report name>/data
/agencies/<agency name>/reports/<report name>/data
/domain/<domain>/reports/<report name>/data
To use the API, please register for an API key below and include it in your query in this fashion:
https://api.gsa.gov/analytics/dap/v1.1/reports/download/data?api_key=DEMO_KEY1
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:
id
: The primary key of the data pointreport_name
: The name of the data point’s reportreport_agency
: The name of the data point’s agencydate_time
: The data/time the data in the data point corresponds todata
: The data associated with the data point. This may contain child properties such as visits, browser, screen size, and so on, depending on the reportReports 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:
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:
For the site
, domain
, download
, and second-level-domain
reports you may use the domain
route, to only return results by domain.
The following query params are supported to work with the data:
limit
: Limit the number of data points that are rendered. The default is 1000 and the max is 10,000page
: Pages through the results. If the limit is set to 1000
, using page=2
will render the 1001st through 2000th data point.after
: Limit the results to in dates on or after the date specified. Expects YYYY-MM-DD
.before
: Limit the results to in dates on or before the date specified. Expects YYYY-MM-DD
.These data provide a window into how people are interacting with the government online. The data come from a unified Google Analytics account for U.S. federal government agencies known as the Digital Analytics Program. This program helps government agencies understand how people find, access, and use government services online. The program does not track individuals, and anonymizes the IP addresses of visitors.
Not every government website is represented in these data. Currently, the Digital Analytics Program collects web traffic from around 520 executive branch government second level domains, across about 6,800 total hostnames, including every cabinet department. We continue to pursue and add more sites frequently; to add your site, email the Digital Analytics Program.
You can download the data here. Available in JSON and CSV format.
Additionally, you can access data via API (currently in Beta).
Due to varying Google Analytics API sampling thresholds and the sheer volume of digital analytics program data, some non-realtime reports may be subject to sampling. The data are intended to represent high level trends and should only be used for general insights into online visitor behavior.