Behind the Drink API

European Mental Health & Alcohol Mortality Data

✅ Livev1.0.0

🚀 Quick Start

Base URL

https://api.behind-the-drink.xyz

Authentication

✅ No API key required

Open access with rate limiting

Try it now:

# Get all available countries
curl https://api.behind-the-drink.xyz/v1/countries

📊 Data Overview

34
European Countries
12
Years (2011-2022)
816
Total Records

Data Fields

  • alcohol_rate - Age-standardized rate per 100,000
  • suicide_rate - Age-standardized rate per 100,000
  • population_total - Total population base for calculations
  • est_alcohol_deaths - Estimated deaths (rounded to whole numbers)
  • est_suicide_deaths - Estimated deaths (rounded to whole numbers)

🧮 How Estimated Deaths Were Calculated

To translate mortality rates into actual numbers of deaths, we used the following method:

1. Source Data

  • Age-standardized death rates (per 100,000) for alcohol-related and suicide mortality were sourced from Eurostat
  • Population counts were sourced from Eurostat's demo_pjan dataset, using total population data

2. Estimation Formula

Estimated Deaths = (Mortality Rate / 100,000) × Total Population

This calculation is performed for each combination of:

  • Country (34 European countries)
  • Year (2011-2022)
  • Sex (F, M, T [total])

3. Why Use This Approach?

Real Human Impact

Goes beyond abstract percentages to show the actual human toll

Meaningful Comparisons

By factoring in actual population sizes, we can make cross-country and gender comparisons more meaningful

Policy Relevance

Provides concrete numbers that policymakers and researchers can use for resource allocation and intervention planning

Accuracy Validation

Our total population method produces estimates that closely align with official national statistics (e.g., Norwegian 2020 data matches official figures)

4. Important Notes

  • ⚠️All death estimates are rounded to whole numbers (e.g., 249 deaths, not 249.2)
  • ⚠️Total (T) values are calculated as the sum of male (M) and female (F) estimates
  • ⚠️Rates remain as precise decimals for statistical accuracy
  • 📝Population Estimation Note: We estimated the number of deaths by applying the standardized rate to the total population. This makes an approximation—since standardized rates assume a weighted age distribution—so the resulting counts are indicative, not exact.

🛠 API Endpoints

GET/v1/countries

List all available countries

GET/v1/data/:country

Get all yearly data for a specific country

GET/v1/data/:country/:year

Get data for a specific country and year

GET/v1/summary

Get statistical summaries with optional filtering

Query params: country, sex, year
GET/v1/metadata

Dataset metadata and coverage information

💻 Code Examples

JavaScript / Fetch

// Get all countries
const countries = await fetch('https://api.behind-the-drink.xyz/v1/countries')
  .then(res => res.json());

// Get Austria data for 2020
const austriaData = await fetch('https://api.behind-the-drink.xyz/v1/data/AT/2020')
  .then(res => res.json());

// Get male suicide statistics
const maleStats = await fetch('https://api.behind-the-drink.xyz/v1/summary?sex=M')
  .then(res => res.json());

Python / Requests

import requests

# Get dataset metadata
metadata = requests.get('https://api.behind-the-drink.xyz/v1/metadata').json()

# Get Germany data
germany = requests.get('https://api.behind-the-drink.xyz/v1/data/DE').json()

# Compare male vs female rates
male_summary = requests.get('https://api.behind-the-drink.xyz/v1/summary?sex=M').json()
female_summary = requests.get('https://api.behind-the-drink.xyz/v1/summary?sex=F').json()

⚡ Performance & Features

Performance

  • Response Time: < 100ms
  • 1 hour cache, 24h stale-while-revalidate
  • Rate limiting: 100 req/min per IP
  • CORS enabled for all origins

Features

  • No authentication required
  • Comprehensive error handling
  • Request logging & monitoring
  • Security headers included

🔗 Links & Support

Resources

Data Sources

  • • Eurostat mortality data
  • • Eurostat population data
  • • License: CC BY 4.0
  • • Built for public health research