Getting Started
Get your first API call working in under two minutes.
1. Get your API key
Sign up for a FetchLayer account and generate an API key from the dashboard. Free tier included — no credit card required.
2. Make your first request
Call any endpoint with curl, or use the TypeScript SDK.
curl
bash
curl -X POST https://api.fetchlayer.dev/reddit/search \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"query":"developer tools","sort":"top","limit":5}' TypeScript SDK
npm install @fetchlayer/reddit
typescript
import { FetchLayer } from '@fetchlayer/reddit';
const client = new FetchLayer({ apiKey: 'sk-your-key' });
const { results } = await client.search({
query: 'developer tools',
sort: 'top',
limit: 10,
}); 3. Understand the response
Every endpoint returns structured JSON. The response envelope is consistent across all endpoints.
json
{
"results": [
{
"title": "What tools do you swear by?",
"subreddit": "webdev",
"author": "devuser",
"score": 3241,
"numComments": 418,
"url": "https://reddit.com/r/webdev/comments/...",
"createdUtc": 1718000000
}
]
}