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.
Rate limit your requests
If you are automating a series of queries, please ensure that you don't block our servers by sending all the requests at once.
We will block keys that are causing an issue, and may block users who repeatedly abuse the service. Please contact us if you have questions about how to use the API safely.
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.
It's recommended to generate a separate key for each application, particularly if they are long running servers. Then if one key is compromised or blocked, then other services will keep running.
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 documentation comprehensively covers the possible queries. Sample queries can be interactively generated and possibilities explored. A few example queries are provided below.