Home
    DiscordDisclaimer

    API Documentation

    Base URL

    https://substancesearch.org/api

    Endpoints

    Get Substance Data

    GET/substance/{slug}

    Returns substance data from all available sources.

    Path Parameters

    ParameterTypeDescription
    slugstringThe URL-friendly slug of the substance (e.g., "lsd", "mdma", "ketamine")

    Response

    Returns a JSON object containing substance data from all available sources.

    Example Request

    curl -X GET https://substancesearch.org/api/substance/lsd

    Example Response

    {
      "tripsit": {
        "name": "LSD",
        "categories": ["psychedelic"],
        "dose_units": "µg",
        "...": "..."
      },
      "psychonautwiki": {
        "name": "LSD",
        "class": "Psychedelic",
        "...": "..."
      }
    }

    Status Codes

    Status CodeDescription
    200Success
    400Bad Request - Invalid slug format
    404Not Found - Substance not found

    Get Substance Data from Specific Source

    GET/substance/{slug}/sources/{source}

    Returns substance data from a specific source.

    Path Parameters

    ParameterTypeDescription
    slugstringThe URL-friendly slug of the substance (e.g., "lsd", "mdma", "ketamine")
    sourcestringThe data source to retrieve information from. Available sources: tripsit, psychonautwiki

    Response

    Returns a JSON object containing substance data from the specified source.

    Example Request

    curl -X GET https://substancesearch.org/api/substance/lsd/sources/tripsit

    Example Response

    {
      "name": "LSD",
      "categories": ["psychedelic"],
      "dose_units": "µg",
      "...": "..."
    }

    Status Codes

    Status CodeDescription
    200Success
    400Bad Request - Invalid slug format or invalid source
    404Not Found - Substance not found or data not available for the specified source