REST API Reference

Call SubScraper directly from any language or HTTP client. All endpoints accept POST requests with a JSON body and return structured JSON. No SDK required.

Base URL

POSThttps://subscraper.dev/api/v1/{endpoint}

Authentication

Pass your API key in the Authorization header on every request:

Authorization: Bearer sk-your-api-key-here
Content-Type: application/json

Need an API key?

Free account — 30 requests, no credit card.

Get free API key →

Examples

curl

curl -X POST https://subscraper.dev/api/v1/search \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"query": "best mechanical keyboard", "sort": "top", "limit": 5}'

JavaScript / TypeScript

const response = await fetch('https://subscraper.dev/api/v1/search', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk-your-api-key-here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    query: 'best mechanical keyboard',
    sort: 'top',
    limit: 5,
  }),
});

const data = await response.json();
console.log(data.results);

Python

import requests

response = requests.post(
    'https://subscraper.dev/api/v1/search',
    headers={
        'Authorization': 'Bearer sk-your-api-key-here',
        'Content-Type': 'application/json',
    },
    json={
        'query': 'best mechanical keyboard',
        'sort': 'top',
        'limit': 5,
    }
)

data = response.json()
print(data['results'])

All Endpoints

Endpoint
/api/v1/search
/api/v1/post
/api/v1/community-posts
/api/v1/community-details
/api/v1/user-profile
/api/v1/user-posts
/api/v1/user-comments
/api/v1/search-communities
/api/v1/search-users
/api/v1/comment-permalink
/api/v1/popular
/api/v1/leaderboard
/api/v1/resolve-url-type
/api/v1/explore

All endpoints accept POST · Auth via Bearer token · Response is always JSON

Error Codes

StatusMeaning
200Success — JSON response in body
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
429Rate limited — slow down or upgrade
500Server error — retry after a moment

Prefer TypeScript?

The SDK wraps all these endpoints with full types and autocompletion — no manual fetch calls needed.

TypeScript SDK →

Ready to make your first API call?

Free tier included — 30 requests, no credit card required.

Get free API key