About

HydraStats API is is an open HTTP-based interface that allows fair use access to the HydraStats database. 7 endpoints provide current and historical drug prices, supply and demand indicators.

Endpoints

/api/price/ — average price for selected subcategories of products (breakdown by date and location)

/api/price/dist/ — price distribution for selected subcategories (breakdown by price bins)

/api/supply/ — number of offers, positions or stores for selected categories of products (breakdown by date and location)

/api/supply/quantity/ — number of instant offers for selected subcategories (breakdown by amount)

/api/supply/category/ — breakdown of offers, positions or stores by category

/api/reviews/ — number of reviews in selected category (breakdown by date and location)

/api/reviews/get/ — get random review

Categories
  • cannabis — includes cannabis buds, leaves, seeds, oil and hashish
  • ecstasy — includes ecstasy pills and MDMA
  • psychedelic — includes LSD, NBOMe, psilocybin mushrooms and other psychedelics
  • amphetamine
  • mephedrone — includes mephedrone crystals and powder
  • alphapvp — includes α-PVP crystals and powder
  • cocaine
  • other — includes substances that were not included in one of the previous categories
Subcategories
  • marijuana — cannabis buds
  • hashish
  • mdma — MDMA crystals and powder
  • ecstasy — ecstasy pills
  • amphetamine
  • mephedrone — Mephedrone crystals and powder
  • alphapvp — α-PVP crystals and powder
  • cocaine
  • lsd
  • mushrooms — psilocybin mushrooms
  • methadone
  • heroine
Cities
Minsk, Brest, Viciebsk, Homiel, Hrodna, Žodzina, Mahiloŭ, Babrujsk, Barysaŭ, Pinsk, Baranavičy, Rečyca, Orša, Słuck, Svietłahorsk, Połack, Žłobin, Mazyr, Salihorsk, Navapołack, Haradok, Maładziečna, Słonim, Brasłaŭ, Lida, Zasłaŭje, Asipovičy, Dziaržynsk, Astraviec

All prices are in USD.

Arguments
  • subcategoryrequired
  • start — first date to retrieve data from, e.g. 2019-12-01. Default: date of the latest snapshot in the database minus 30 days
  • end — last date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database
  • quantity_start — smallest offer quantity to count, e.g. 1 (grams or units). Default: 0
  • quantity_end — largest offer quantity to count, e.g. 10. Default: 10
  • city — city to restrict results or "breakdown" for a breakdown by locality
  • unique1 to drop identical offers in a city, 0 otherwise. Default: 1
  • averaging — "median", "mean" or "min". Defines averaging function. Default: median
  • integral1 to count average for the whole date interval, 0 for a breakdown by date. Can't be 1 if averaging=min. Default: 0
Examples

/api/price/?subcategory=marijuana gives the median price for a gram of cannabis buds in Belarus counting offers of 0-10 grams for the last 30 days.

/api/price/?subcategory=ecstasy&start=2019-05-01&end=2020-05-01&quantity_start=5&quantity_end=10&integral=1&city=Minsk gives median price of an ecstasy pill in Minsk over a year, counting offers from 5 to 10 pills.

/api/price/?subcategory=mephedrone&start=2019-05-01&end=2020-05-01&city=breakdown&integral=1 gives city breakdown of the median price of mephedrone over a year.

Gives price distribution for a subcategory. Response contains a list with the number of appearances "hist", and a list of bin edges "bins".

Arguments
  • subcategoryrequired
  • bins — number of bins. Default: 10
  • start — first date to retrieve data from, e.g. 2019-12-01. Default: date of the latest snapshot in the database minus 30 days
  • end — last date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database
  • quantity_start — smallest offer quantity to count, e.g. 1 (grams or units). Default: 0
  • quantity_end — largest offer quantity to count, e.g. 10. Default: 10
  • city — city to restrict results
  • unique1 to drop identical offers in a city, 0 otherwise. Default: 1
  • integral1 to count average for the whole date interval, 0 for a breakdown by date. Default: 0
Examples

/api/price/dist/?subcategory=marijuana&city=Minsk gives the distribution of marijuana price in Minsk for the last 30 days

/api/price/dist/?subcategory=cocaine&start=2019-05-01&end=2020-05-01&integral=1 gives cocaine price distribution data for a year

Gives the number of instant offers, positions or stores (see argument unique)".

Arguments
  • category — category to restrict results
  • start — first date to retrieve data from, e.g. 2019-12-01. Default: date of the latest snapshot in the database minus 30 days
  • end — last date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database
  • city — city to restrict results to or "breakdown" for a breakdown by locality
  • unique3 to get stores, 2 to get positions, 1 to get unique offers, 0 to get offers without dropping identical offers in a city. Default: 1
  • integral1 to count average for the whole date interval, 0 for a breakdown by date. Default: 0
Examples

/api/supply/ gives current number of unique instant offers

/api/supply/?category=psychedelic&Minsk&unique=2 gives the number of unique psychedelic products that were available in Minsk in the last 30 days

/api/supply/?category=alphapvp&unique=3&start=2020-01-01&end=2020-12-31&integral=1 gives the number of stores that were selling α-PVP in 2020

Gives the number of instant offers, positions or stores with a breakdown by category.

Arguments
  • date — date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database
  • city — city to restrict results
  • unique3 to get stores, 2 to get positions, 1 to get unique offers, 0 to get offers without dropping identical offers in a city. Default: 1
Examples

/api/supply/category/ gives current distribution of unique offers by category

/api/supply/category/?date=2020-01-01 gives no data as there is no snapshot of 2020-01-01

Gives a breakdown of instant offers in a subcategory by quantity.

Arguments
  • date — date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database
  • city — city to restrict results
  • unique1 to drop identical offers in a city, 0 otherwise. Default: 1
Examples

/api/supply/quantity/?subcategory=marijuana gives a current breakdown of unique marijuana offers by quantity

Gives the number of customer reviews with a breakdown by locality and date

Arguments
  • start — first date to retrieve data from, e.g. 2019-12-01. Default: date of the latest snapshot in the database minus 30 days
  • end — last date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database minus 3 days
  • rating_start — the smallest rating to count. Default: 0
  • rating_end — the highest rating to count. Default: 10
  • category — category to restrict results
  • city — city to restrict results or "breakdown" for a breakdown by locality
  • integral1 to count reviews for the whole date interval, 0 for a breakdown by date. Default: 0
Examples

/api/reviews/?start=2020-01-01&end=2020-01-31&integral=1 gives the number of reviews for January 2020

/api/reviews/?start=2020-01-01&end=2020-01-31&category=cannabis&city=Minsk gives a breakdown of the number of reviews on cannabis products in Minsk

Gives the text of a random review.

Arguments
  • start — first date to retrieve data from, e.g. 2019-12-01. Default: date of the earliest snapshot in the database
  • end — last date to retrieve data from, e.g. 2020-01-01. Default: date of the latest snapshot in the database minus 3 days
  • rating_start — the smallest rating to consider. Default: 0
  • rating_end — the highest rating to consider. Default: 10
  • category — category to restrict results
  • city — city to restrict results
Examples

/api/reviews/get/ gives a random review from the database

/api/reviews/get/?rating_end=1&category=alphapvp gives a random unsatisfactory review about α-PVP

Home Prices Supply Reviews

HydraStats © Piotr Markielau 2020

Contact