Authentication
Authenticate your API requests with an API key.
API Key Format
API keys start with nrf_ followed by 64 hexadecimal characters.
nrf_a1b2c3d4e5f6...
Generate keys from your dashboard.
Authentication Methods
Recommended
Authorization Header
Pass your key in the Authorization header using the Bearer scheme.
bash
curl "https://api.newsrank.ai/v1/stories" \
-H "Authorization: Bearer nrf_your_api_key"javascript
const response = await fetch("https://api.newsrank.ai/v1/stories", {
headers: {
"Authorization": "Bearer nrf_your_api_key"
}
});Deprecated
Query Parameter
Pass your key as the api_key query parameter. This method is deprecated because it risks leaking credentials in server logs, browser history, and referrer headers. Use the Authorization header instead.
bash
curl "https://api.newsrank.ai/v1/stories?api_key=nrf_your_api_key"javascript
const response = await fetch(
"https://api.newsrank.ai/v1/stories?api_key=nrf_your_api_key"
);Scopes
API keys are assigned a scope that determines what operations they can perform.
| Scope | Access | Description |
|---|---|---|
read | Read-only | Access all GET endpoints. Suitable for most integrations. |
write | Read + Write | Everything in read, plus ability to create and modify resources. |
admin | Full access | Complete API access including administrative operations. |
ws:connect | WebSocket | Connect to the real-time WebSocket feed. Available on paid plans. |