Skip to content

PubMLST API setup tutorial for FastMLST

Enzo Guerrero-Araya edited this page Apr 10, 2026 · 1 revision

PubMLST API setup tutorial for FastMLST

This tutorial shows how to create your PubMLST API credentials and use them with FastMLST.

Before you start

  • You need a PubMLST account.
  • You need FastMLST installed.
  • These steps only need to be completed once for each PubMLST account.

1. Create a PubMLST account

If you do not already have a PubMLST account, create one and follow the registration instructions on the website.

Step 1

2. Open MY ACCOUNT

After you have access to your account, go to MY ACCOUNT in the top-right corner of the PubMLST website.

Step 2

3. Register for databases

Open Database registrations and select all available databases using Check all.

Step 3

4. Submit the registration

Press the REGISTER button to complete the database registration.

5. Open API keys

After registering the databases, go to API keys.

Step 4

6. Create a new API key

Create a new API key by pressing the SUBMIT button. You can change the key name before creating it if you want.

Once the key is created, save the following values:

  • Client id
  • Client secret
Step 6

7. Connect FastMLST with your credentials

Use your Client id and Client secret with FastMLST:

fastmlst --pubmlst-connect \
  --pubmlst-client-id "YOUR_CLIENT_ID" \
  --pubmlst-client-secret "YOUR_CLIENT_SECRET"

Example:

fastmlst --pubmlst-connect \
  --pubmlst-client-id "KzXGdTYf1cf4fnWbxON8SN7t" \
  --pubmlst-client-secret "JookHVPRgmCRnaZrhFzcTa0qtgvi62udcw7Cw0nlFm"

This command opens the PubMLST authorization flow in your browser and stores the access tokens locally for future use.

Authorize FastMLST in your browser and paste the verifier code:
https://pubmlst.org/bigsdb?db=pubmlst_neisseria_seqdef&page=authorizeClient&oauth_token=MISwl272pbgppOtAsZdmwuw4J42FmEim
OAuth verifier: 

8. List available schemes

After the connection is configured, you can list the available PubMLST schemes:

fastmlst --scheme-list
(1) pubmlst_achromobacter_seqdef_1 | pubmlst_achromobacter_seqdef:1 | achromobacter | MLST
(2) pubmlst_abaumannii_seqdef_1 | pubmlst_abaumannii_seqdef:1 | abaumannii | MLST (Oxford)
(3) pubmlst_abaumannii_seqdef_2 | pubmlst_abaumannii_seqdef:2 | abaumannii | MLST (Pasteur)
(4) pubmlst_abaumannii_seqdef_3 | pubmlst_abaumannii_seqdef:3 | abaumannii | cgMLST v1
(5) pubmlst_actinobacillus_seqdef_1 | pubmlst_actinobacillus_seqdef:1 | actinobacillus | MLST
(6) pubmlst_aeromonas_seqdef_1 | pubmlst_aeromonas_seqdef:1 | aeromonas | MLST
(7) pubmlst_aactinomycetemcomitans_seqdef_1 | pubmlst_aactinomycetemcomitans_seqdef:1 | aactinomycetemcomitans | MLST
(8) pubmlst_aphagocytophilum_seqdef_1 | pubmlst_aphagocytophilum_seqdef:1 | aphagocytophilum | MLST
(9) pubmlst_aphagocytophilum_seqdef_2 | pubmlst_aphagocytophilum_seqdef:2 | aphagocytophilum | ankA
(10) pubmlst_aphagocytophilum_seqdef_3 | pubmlst_aphagocytophilum_seqdef:3 | aphagocytophilum | groEL

9. Download a scheme

You can download any listed scheme with --update-mlst. For example:

fastmlst --update-mlst "pubmlst_cdifficile_seqdef_1"

Summary

After completing these steps, you will be able to:

  • authenticate FastMLST with PubMLST,
  • list available schemes,
  • download the schemes you want to use locally.