StackExchange API

StackExchange API

Access 200+ million questions, answers, and insights with programmatic access to StackExchange data

Millions of Data Points

Access 100+ years of programming history, developer insights, and technical knowledge

Comprehensive Coverage

All major technologies, frameworks, and methodologies represented

Real-time Engagement

Stay up to date with live question tracking and notifications

Authentication

Secure your API access with OAuth 2.0 authentication. Create an API key at Developer Portal

Client Credentials

curl -X POST "https://api.stackexchange.com/v3.0/access-tokens" \
     -H "Authorization: ClientSecret YOUR_CLIENT_SECRET" \
     -H "Content-Type: application/json" \
     -d '{"grant_type": "client_credentials"}'

Using Access Token

curl -X GET "https://api.stackexchange.com/v3.0/questions" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Getting Started

Quick Example: Search Questions

GET /questions/search/advanced
Host: api.stackexchange.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Body:
{
  "site": "stackoverflow",
  "q": "javascript event loop",
  "sort_by": "votes"
}

1. Create Application

Register your app at the Developer Portal to obtain API credentials

Register Application

2. Get Access Token

Obtain an access token using your application's credentials

Authentication Docs

3. Call API Endpoints

Use your access token to call various API endpoints

Explore Endpoints

API Endpoints

Questions

GET

Search, retrieve, and manage questions and answers

/api/questions?[search terms]&site=[stacksite]&sort=[sort]

Tags

GET

Retrieve information about question tags and usage statistics

/api/tags?[site]&filter=[filter]

Users

GET

Access user profiles, reputation, and activity history

/api/users/[user_ids]?site=[stacksite]

Badges

GET

Retrieve information about badges and achievements

/api/badges?[site]&filter=[filter]