Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Latest commit

 

History

History
62 lines (42 loc) · 1.11 KB

File metadata and controls

62 lines (42 loc) · 1.11 KB

harm reduction api for substance information

quick start

with docker (recommended)

# build and run
docker-compose up --build

# or run in background
docker-compose up -d --build

api will be available at http://localhost:8080

without docker

# install python 3.7+
pip install -r requirements.txt

# run
python app.py

api endpoints

  • GET / - api documentation
  • GET /api/substance/{slug} - get substance data from all sources
  • GET /api/substance/{slug}/sources/{source} - get substance data from specific source

examples

# get lsd data
curl http://localhost:8080/api/substance/lsd

# get lsd data from tripsit only
curl http://localhost:8080/api/substance/lsd/sources/tripsit

# get api docs
curl http://localhost:8080/

data sources

  • tripsit - community harm reduction database
  • psychonautwiki - research-based substance info

production

the docker setup includes:

  • gunicorn wsgi server
  • health checks
  • non-root user
  • optimized for production

links