API/Web services#
The BacDive API#
New in 2026: BacDive API v2
Version 2 for the BacDive API endpoints has been introduced due to changes in the structure of the Genome Sequences data. While the original endpoints remain available to ensure backward compatibility, they are not updated with new data anymore and will remain at the content state of April 2025. We recommend migrating as new data added in the December 2025 release (and upcoming releases) is only available through the BacDive API v2!
No registration/login required anymore
From February 2026, registration through the DSMZ Keycloak server is not required anymore to use the BacDive API. The API is now freely accessible — no sign-up, no account needed.
Watch our BacDive API Introduction Tutorial
APIs#
An API (Application Programming Interface) is a set of procedures that allows two applications to communicate with each other. These procedures can be used to write code that communicates with another application, like a software or a website like BacDive. Through API procedures, requests to websites can be automated.
The BacDive API#
The BacDive API can be found at https://api.bacdive.dsmz.de/ or by clicking on the 'Web services' tab on the BacDive website.
For all requests, the requested data is returned in JSON format with the following fields:
- count - Number of entries retrieved
- next - URL to next page if results are paginated, otherwise 'null'
- previous - URL to previous page if results are paginated, otherwise 'null'
- results - Requested data
When data for a large number of strains is delivered, the results are paginated at 100 strains per page (JSON file).
Endpoints#
The BacDive API has five different endpoints (network locations) that can be used to send requests and receive data.
The endpoints can be tested in the browser by adding the name of the desired endpoint to the BacDive API URL and then specifying the query.
fetch#
API requests to this endpoint are made by BacDive ID and return all BacDive information on the strain(s). All other endpoints return BacDive IDs that can then in turn be searched using fetch.
Browser example:
https://api.bacdive.dsmz.de/v2/fetch/5621
A detailed explanation of the data fields in the delivered JSON file can be found here.
Data for several BacDive strains can be requested at the same time when their IDs are delimited by semicolons. There is a limit of 100 IDs per call.
Browser example:
https://api.bacdive.dsmz.de/v2/fetch/5621;139709
culturecollectionno#
API requests to this endpoint are made by culture collection number and return BacDive IDs.
Browser example:
https://api.bacdive.dsmz.de/v2/culturecollectionno/DSM 2801
taxon#
API requests to this endpoint are made by genus, species or subspecies name and return the BacDive IDs of all strains present for that taxon in the BacDive database.
Browser example for a genus name:
https://api.bacdive.dsmz.de/v2/taxon/Myroides
Browser example for a species name:
https://api.bacdive.dsmz.de/v2/taxon/Myroides/odoratus
Browser example for a subspecies name:
https://api.bacdive.dsmz.de/v2/taxon/Myroides/odoratimimus/xuanwuensis
sequence_16s#
API requests to this endpoint are made by 16S rRNA gene nucleotide accession numbers and return BacDive IDs.
Browser example:
https://api.bacdive.dsmz.de/v2/sequence_16s/M58777
sequence_genome#
API requests to this endpoint are made by genome assembly accession numbers and return BacDive IDs.
Browser example:
https://api.bacdive.dsmz.de/v2/sequence_genome/GCA_000243275
The BacDive R Package#
Watch our BacDive API R Package Tutorial
Installation#
The BacDive R Package can be found at https://r-forge.r-project.org/R/?group_id=1573.
It can be installed within an R session using the install.packages() function.
Initialization#
The BacDive client is initialized using the open_bacdive() function.
R functions#
fetch()#
The fetch() function implements a request to the fetch endpoint of the API.
As parameters, the fetch() function takes the client object, initialized earlier, and one or more BacDive IDs.
The returned strain information is stored in the $results field.
For easier handling, the output can be transformed to a data frame.
request()#
The request() function implements requests to the four other endpoints of the BacDive API.
As parameters, the request() function takes the client object, a query and a search parameter specifying the queried endpoint.
A request to the culturecollectionno ("deposit") endpoint:
The returned BacDive ID can be found in the $results field
A request to the sequence_genome ("genome") endpoint:
The taxon endpoint differs from the culturecollectionno and sequence endpoints as a request usually returns not just one, but several BacDive IDs.
In the following example request to the taxon ("taxon") endpoint using the species name Myroides odoratus, the count field of the output shows that 19 strains of this species are present in the database. The results field contains all 19 BacDive IDs.
In other cases, the retrieve() function should be used.
retrieve()#
The retrieve() function can retrieve data directly using non BacDive IDs and taxon names. It can retrieve data for any number of strains without the limitation of the request() function.
As parameters, the retrieve() function takes the client object, a query and a search parameter specifying the queried endpoint.
Here the taxon enpoint is again queried for the genus Myroides.
Examples#
With the available data on all Myroides strains now stored in a data frame, specific data fields can be looked up.
In this example, the number of Myroides strains, which are type strains for their species is counted, by iterating through the rows of the data frame and asking whether the type strain field is filled with a 'yes'.
In a second example the BacDive IDs of a number of DSM strains are looked up, in this case the strains DSM 1 to DSM 20.
After the initialization of an output data frame, a for-loop goes through the numbers 1 to 20. The prefix "DSM" is added to each number to make the DSM indentifier , which is then used as query in a request to the culturecollectionno endpoint. If the DSM strain is present in BacDive, the count field of the received output says '1' and the BacDive ID is saved to the data frame. Otherwise, an 'NA' is put into the respective field.
The BacDive Python package#
Watch our BacDive API Python Package Tutorial
Installation#
The BacDive Python package is available in the Python Package Index (PyPI): https://pypi.org/project/bacdive/.
It can be installed in a UNIX terminal using the pip installer.
Initialization#
The BacDive client needs to be initialized.
Python methods: search and retrieve#
The 'search' method takes BacDive IDs, other IDs or taxon names and fetches and stores all BacDive IDs that are found for this query.
This is an example for a search with a BacDive ID using the 'id' parameter:
The actual data for the strains whose IDs were stored with the 'search' method can then be retrieved using the 'retrieve' method.
The method returns a nested dictionary that contains all the information on the strains that are in BacDive and that you could also see on the BacDive website if you would search for the strain there.
This also works with more than one BacDive ID.
Example using two BacDive IDs and printing out only the general information on the strains when using the 'retrieve' method:
For API requests with taxon names, the 'taxonomy'parameter is used in the 'search' method.Example with a genus name:
Example with a species name:
Again all the BacDive IDs of strains of this species that are present in the BacDive database are stored.
Instead of retrieving the complete data on the strains and then using only a small part of it, as in the previous example, the 'retrieve' function can also be used with filters by specifying which information shall be retrieved.
For this, a list of keys specifying the data fields to be retrieved is added to the 'retrieve' function as parameter.
In this example only the culture collection numbers of the previously searched Myroides odoratus strains are retrieved:
Of course this can also be done the other way round. This example shows a search with a culture collection number. In this case, another filter is given in the 'retrieve' method: the taxonomic family information.Information on the same strains can again be retrieved with other filters.
In this example, a list of two filters is given in the 'retrieve' function, they are the full scientific name field and the information that the stored in the culture medium field.
Example#
Again, the BacDive IDs of a number of DSM strains 1 to 20 are looked up.
In the second example, all the strains of the genus Myroides are again searched. Then, I want to now which species these strains belong to.