TrafficLens API
Fetch website traffic, rankings, engagement, keywords and WHOIS data for any domain — one at a time or up to 100 in a single request. A simple, key-authenticated REST API that returns clean JSON.
Introduction
The TrafficLens API is organised around REST. It has predictable, resource-oriented URLs, accepts query parameters, returns JSON, and uses standard HTTP response codes and verbs.
Base URL
https://api.trafficlens.space/v1
All requests must be made over HTTPS and authenticated with an API key.
Authentication
Authenticate by sending your secret key in the X-API-Key header. Keys look like tl_live_…. Keep them secret — never expose a key in client-side code.
Copycurl -H "X-API-Key: tl_live_YOUR_KEY" \
"https://api.trafficlens.space/v1/traffic?domain=stripe.com"
You can also pass it as a bearer token: Authorization: Bearer tl_live_YOUR_KEY.
Quotas & metering
Every key has a quota (a number of lookups). Usage is metered per request:
/trafficcosts 1 per call./bulkcosts 1 per resolved domain in the response.- Failed upstream calls (HTTP 502) are not charged.
Quota is a one-time balance — it does not auto-reset. When it runs out, requests return 429; top it up any time. Check your remaining balance with /me.
Rate limits
Each key is limited to 60 requests per minute. This is separate from your quota — the quota caps your total lookups, the rate limit caps how fast you send them. Exceeding it returns 429 with a Retry-After header; wait and retry.
HTTP/1.1 429 Too Many Requests
Retry-After: 60
{ "detail": "Rate limit exceeded — max 60 requests/minute." }
Need a higher limit for a high-volume integration? Get in touch.
Errors
TrafficLens uses conventional HTTP status codes. The body is always JSON with a detail message on error.
| Code | Meaning |
|---|---|
| 200 | Success. |
| 400 | Bad request — invalid or missing domain. |
| 401 | Missing, invalid or inactive API key. |
| 429 | Quota reached (top up) or rate limit exceeded (slow down — see Retry-After). |
| 502 | Upstream temporarily unavailable — retry. |
GET /traffic
Return the full profile for a single website. Costs 1 from your quota.
Query parameters
| Parameter | Type | Description |
|---|---|---|
domain required | string | Website to look up, e.g. stripe.com. Scheme and path are stripped automatically. |
Example request
Copycurl -H "X-API-Key: tl_live_YOUR_KEY" \
"https://api.trafficlens.space/v1/traffic?domain=stripe.com"
Example response
{
"domain": "stripe.com",
"status": "OK",
"traffic": {
"visits": 120792625,
"change": -0.0131,
"monthly": [
{ "month": "2026-05-01", "visits": 122394040 },
{ "month": "2026-06-01", "visits": 120792625 }
]
},
"rank": { "global": 325, "country": 244 },
"engagement": {
"bounce_rate": 0.556,
"pages_per_visit": 3.21,
"time_on_site": 164.6
},
"whois": {
"registration_date": "1995-09-12T04:00:00Z",
"expiration_date": "2027-09-11T04:00:00Z",
"last_changed": "2025-10-01T01:39:51Z"
},
"meta": { "data_month": "2026-06", "title": "Stripe", "description": "…" },
"keywords": [
{ "name": "stripe", "volume": 2854510, "cpc": 2.12, "estimatedValue": 3053940 }
]
}
GET /bulk
Look up many websites in one request — up to 100 domains. Costs 1 per resolved domain.
Query parameters
| Parameter | Type | Description |
|---|---|---|
domains required | string | Comma-separated list of domains (max 100). Duplicates are removed. |
Example request
Copycurl -H "X-API-Key: tl_live_YOUR_KEY" \
"https://api.trafficlens.space/v1/bulk?domains=github.com,stripe.com,wikipedia.org"
Example response
{
"count": 3,
"results": [
{ "domain": "github.com", "status": "OK", "traffic": { "visits": 615239605, … }, … },
{ "domain": "stripe.com", "status": "OK", … }
]
}
GET /me
Return your key's quota and current usage. Free — does not count against your quota.
Example
Copycurl -H "X-API-Key: tl_live_YOUR_KEY" "https://api.trafficlens.space/v1/me"
{ "label": "Acme Inc", "quota": 10000, "used": 3421, "remaining": 6579 }
GET /health
Liveness check. No authentication required.
curl "https://api.trafficlens.space/v1/health" → { "status": "ok" }
The result object
Every resolved domain returns the same shape:
| Field | Type | Description |
|---|---|---|
domain | string | The looked-up domain. |
status | string | OK or UNREGISTERED (no data). |
traffic.visits | integer | Latest-month total visits. |
traffic.change | float | Month-over-month change (ratio, e.g. -0.0131 = −1.31%). |
traffic.monthly | array | Up to 12 months of { month, visits }. |
rank.global | integer | Global traffic rank. |
rank.country | integer | Rank in the top country. |
engagement.bounce_rate | float | Bounce rate (0–1). |
engagement.pages_per_visit | float | Average pages per visit. |
engagement.time_on_site | float | Average visit duration (seconds). |
whois.* | string | Registration, expiration and last-changed dates (ISO 8601). |
meta.* | string | Data month, page title and description. |
keywords | array | Top keywords with name, volume, cpc, estimatedValue. |
Code examples
Python
Copyimport requests
r = requests.get(
"https://api.trafficlens.space/v1/traffic",
params={"domain": "stripe.com"},
headers={"X-API-Key": "tl_live_YOUR_KEY"},
)
data = r.json()
print(data["traffic"]["visits"])
Node.js
Copyconst res = await fetch(
"https://api.trafficlens.space/v1/traffic?domain=stripe.com",
{ headers: { "X-API-Key": "tl_live_YOUR_KEY" } }
);
const data = await res.json();
console.log(data.traffic.visits);
Support
Questions, higher quotas, or a custom plan? We're happy to help.