The API

Programmatic access to Pathogenwatch

About the API

Pathogenwatch provides an API enabling users to write scripts for interacting with Pathogenwatch, and for other databases to automatically extract data for their own use. For instance, the daily updated genome assemblies from the ENA can be directly queried and downloaded. The API is RESTful, and requires a user key for authentication.

triangle-exclamation

Rate limit your requests

Getting started

To access the API, the first step is generate an API key associated with a user account. Click on "My account" in the top right corner to access your account page, and then scroll to the bottom. The "API keys" section will list any keys you've already generated, and allows you to generate new ones.

circle-exclamation
The API key section is found at the bottom off the "My account" page

Clicking "+Create Key" will bring up a request to name it. Enter the name and the key will be added to your API key section.

The key generation pop up. The key is named "my_pipeline" here.

To view or copy the key use the eye and clipboard icons in the "Value" field respectively.

The "my_pipeline" key has been added to the user account.

Using the API

The API documentationarrow-up-right comprehensively covers the possible queries. Sample queries can be interactively generated and possibilities explored. A few example queries are provided below.

circle-info

The complete API documentation can be found at https://next.pathogen.watch/docs/apiarrow-up-right, along with the OpenAPI specification.

Last updated