API v1.0

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.

Need a key? Keys are issued on request — email us and we'll set you up with a quota.

Quotas & metering

Every key has a quota (a number of lookups). Usage is metered per request:

  • /traffic costs 1 per call.
  • /bulk costs 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.

CodeMeaning
200Success.
400Bad request — invalid or missing domain.
401Missing, invalid or inactive API key.
429Quota reached (top up) or rate limit exceeded (slow down — see Retry-After).
502Upstream temporarily unavailable — retry.

GET /traffic

Return the full profile for a single website. Costs 1 from your quota.

Query parameters

ParameterTypeDescription
domain requiredstringWebsite 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

ParameterTypeDescription
domains requiredstringComma-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:

FieldTypeDescription
domainstringThe looked-up domain.
statusstringOK or UNREGISTERED (no data).
traffic.visitsintegerLatest-month total visits.
traffic.changefloatMonth-over-month change (ratio, e.g. -0.0131 = −1.31%).
traffic.monthlyarrayUp to 12 months of { month, visits }.
rank.globalintegerGlobal traffic rank.
rank.countryintegerRank in the top country.
engagement.bounce_ratefloatBounce rate (0–1).
engagement.pages_per_visitfloatAverage pages per visit.
engagement.time_on_sitefloatAverage visit duration (seconds).
whois.*stringRegistration, expiration and last-changed dates (ISO 8601).
meta.*stringData month, page title and description.
keywordsarrayTop 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.

Chaudhary.nikhil8585@gmail.com — we usually reply within a few hours.