API Documentation
This page is intended to help developers integrating Mixtures.info data into a third party application. Our database contains 35 substances linked by 192 interactions, available in JSON format through an HTTP service.
balance Terms of use
License
All data is distributed under the Creative Commons CC-BY-SA 4.0 license. Any work using this API must conform to the terms of this license, including the obligation to give credit and to share any derived work under the same license.
Best practices
Please use this API responsibly. This includes throttling your queries, and making as few requests as possible to perform a given action.
It is good practise to use local caches when possible. Instead of performing lots of search queries, we provide an aliases
endpoint you can locally cache to perform searches locally.
We may suspend access to the API in case of misuse.
translate Internationalization
All API endpoints use internationalization. The desired response language can be specified by prefixing the API URIs with a language code (eg. /en/api/v1/...
for English). If no language prefix is provided (/api/v1/...
), the system will try to pick one according to your request headers and will perform a redirect.
Avalaible language codes:
fr
,
en
.
link Endpoints
GET http://mixtures.info/api/v1/aliases/
A list of all avalaible aliases, mapping them to substance slugs and URLs.
This is useful for caching or if you want to implement your own search logic locally.
GET http://mixtures.info/api/v1/search/:name/
Parameter | Converter |
---|---|
name |
StringConverter |
Get a substance by name and return its slug and URL.
Database slugs, names and aliases will be matched against the query.
GET http://mixtures.info/api/v1/substances/
List all substances in the database, and get a basic summary of them.
GET http://mixtures.info/api/v1/substance/:slug/
Parameter | Converter |
---|---|
slug |
SlugConverter |
Get some detailled information about a substance and a basic summary of its interactions.
The slug
parameter has to be exact, use the search
endpoint to get a substance slug from its name or aliases.
GET http://mixtures.info/api/v1/combo/:slugs/
Parameter | Converter |
---|---|
slugs |
SlugListConverter |
Get detailled information about a substance combination.
The slugs
parameter must be a list of valid slugs sepatared by plus characters (eg. .../combo/drug-a+drug-b/
). A maximum of 5 substances is allowed in each query.