API reference
Most of what the dashboard does with sites, campaigns, points and statistics, you can do from code. A few things need you signed in to the dashboard (see below). Requests and answers are JSON.
Basics
The base address is https://api.hitlane.xyz/v1. The full description, for code generators and tools, is the OpenAPI document at https://api.hitlane.xyz/v1/openapi.json.
Authentication
Create a key on the API page of the dashboard and send it with every request:
Authorization: Bearer hl_live_...
A key can read, or read and write. Free keys read only; on Plus and Pro a key can also make the calls that change something: campaigns, sites, transfers and your time zone. In the list below, a call that changes something has a filled method. A read-and-write key can also send points to other members, up to 250,000 a day, so keep it as secret as a password. The full key is shown once, when you create it. A key can also be limited to IP addresses and ranges; from any other address it is refused with ip_not_allowed.
Done in the dashboard only
Some things need you signed in to the dashboard. An API key is refused with session_required:
- Adding funds, and buying points, a plan or extra campaign slots. A key that leaks can never spend your money.
- Seeing, creating, changing and revoking API keys and viewer access keys. A key can never make another key.
- Your sign-in: setting or changing your password, and connecting or disconnecting Google.
- Choosing your username and changing your avatar.
- Deleting your account.
- Support tickets: opening, reading, answering and closing them.
- Marking notifications read, so a key can't hide the notice of a send it made.
Rate limits
| Plan | Requests |
|---|---|
| Free | 60 requests a minute |
| Plus | 300 requests a minute |
| Pro | 1,200 requests a minute |
Past the limit, the API answers 429 with a Retry-After header in seconds. Statistics allows 60 reads an hour and the Overview's charts 120, for each member, dashboard and keys together.
Errors
Every error is JSON with a stable code to branch on and a message to show people. A request that doesn't validate lists the fields at fault in issues.
{ "error": { "code": "invalid_campaign", "message": "...", "issues": [ ... ] } }
Every answer carries an X-Request-Id header that Hitlane made for that request: quote it when you write to support. An error on Hitlane's side answers 500 with the code internal_error, and its body carries the same id as requestId.
While Hitlane is down for maintenance, member calls answer 503 with the code maintenance, until (the end an admin set, in milliseconds since 1970, or null) and a Retry-After header in seconds. GET /v1/status needs no key, and its entry lists the calls that stay open.
A request body may be at most 64 KB (65,536 bytes), or 4 MB (4,194,304 bytes) to create or edit a campaign. A larger one answers 413 with the code body_too_large and the limit in bytes as maxBytes.
Example
curl https://api.hitlane.xyz/v1/campaigns \
-H "Authorization: Bearer hl_live_..." \
-H "Content-Type: application/json" \
-d '{"title": "Launch", "siteId": "sit_...", "urls": ["https://your-site.example/launch"], "durationS": 60}'
Account
GET /v1/account
Your account: plan, limits, balance, reserved and available points, and the dashboard language you chose (null until you choose).
PATCH /v1/account
Change your time zone, the dashboard's language, or both. Body: { timeZone?, language? }, at least one; timeZone is a time zone name such as America/New_York, and language is en or es. Busy hours, daily caps and the Overview follow the time zone.
Overview
GET /v1/dashboard/summary
The Overview's cards: your points (available, balance, reserved), your funds in US cents and whether adding funds is open (the same answer as GET /v1/shop), campaigns running, slots in use and your slots, extra slots included, points earned and spent and visits received since your local midnight, and viewers online.
GET /v1/dashboard/visits
Visits to your campaigns and the points spent on them, per hour; houseVisits is the part from Hitlane's own viewers. Query: range=today|yesterday|7d in your time zone (default today), campaign (one campaign id; every campaign when left out).
GET /v1/dashboard/earnings
Points earned per hour, by viewing and from referrals. Query: range=today|yesterday|7d in your time zone (default today).
GET /v1/dashboard/network
Visits across all of Hitlane per hour of your today, and every visit delivered since launch; houseVisits per hour and houseSinceLaunch are the parts from Hitlane's own viewers.
GET /v1/dashboard/first-steps
The Overview's checklist for a new member: whether you have added a site, created a campaign, run a viewer and had a visit charged to one of your campaigns. Each turns true the first time and stays true.
Campaigns
GET /v1/campaigns
List campaigns, each with its display status and visits in the last 24 hours, plus slots in use. Query: view=active|archive, q (title, page address or id), status.
POST /v1/campaigns
Create a campaign.
Body, as JSON
| Field | Type | Notes |
|---|---|---|
title required | string | at most 200 characters |
siteId required | string | One of your sites; a campaign stays on its site. |
urls required | array of strings | Pages on the campaign's site, one picked at random per visit: 1 on Free and Plus, up to 300 on Pro. |
durationS required | integer | Seconds per visit: Free 30 to 60, Plus 30 to 300, Pro 30 to 600. |
countriesMode | one of "all", "only", "except" | Plus and Pro. "only" and "except" use the countries list. |
countries | array of strings | Two-letter country codes, such as "US". |
dailyCap | integer or null | Plus and Pro. Most visits a day; null for none. |
totalCap | integer or null | Plus and Pro. Most visits in all; the campaign ends there. |
endAt | date and time (ISO 8601) or null | Plus and Pro. The campaign ends at this time; null for none. |
busyHours | integer | Plus and Pro. A 24-bit mask of the hours visits may arrive, bit 0 for midnight to 1:00 in your time zone. 16777215 is every hour. |
delivery | one of "steady", "fast" | Plus and Pro. "steady" spreads the daily cap over the busy hours. |
repeatSpacingS | integer or null | Plus and Pro. Seconds before one viewer visits again, 300 to 259,200; null for 1 hour. |
hourlyMax | array of integers or null | Plus and Pro. 24 numbers, one per hour of your time zone from midnight: -1 for no visits that hour, 0 for no limit, or the most visits that hour, up to 100,000; null for none. Hours set to -1 and busyHours stay in step. |
hourlyMin | array of integers or null | Plus and Pro. 24 numbers: the campaign is offered first until that hour has that many visits, up to 600, never above the hour's maximum and never in a closed hour; null for none. |
minSpeedMbps | integer | Plus and Pro. The slowest connection a viewer may have, in Mbit/s, up to 1,000; 0 for any. A viewer that hasn't measured never passes. |
minCpuScore | integer | Plus and Pro. The lowest score from the viewer's own speed test, up to 1,000; 0 for any. A viewer that hasn't measured never passes. |
networkTypes | array of one of "home", "business", "vpn", "datacenter"s | Plus and Pro. Any of "home", "business", "vpn", "datacenter"; "home" and "business" only together. |
viewerPlatforms | array of one of "windows", "linux", "docker"s | Plus and Pro. Any of "windows", "linux" and "docker", the platform each viewer reports; at least one. A new campaign accepts all three, and a viewer that reports none of them visits only campaigns that accept all three. |
blockIps | array of strings | Plus and Pro. IPv4 addresses and ranges such as 203.0.113.0/24 that never visit, up to 500. |
blockAsns | array of integers | Plus and Pro. Network numbers that never visit, up to 500. |
blockMembers | array of strings | Plus and Pro. Member ids whose viewers never visit, up to 500. |
allowJavascript | boolean | Every plan. false loads the pages without their scripts. |
allowImages | boolean | Every plan. false loads the pages without pictures. |
allowCookies | boolean | Every plan. false sends and keeps no cookie. Every visit is wiped afterwards either way. |
GET /v1/campaigns/{id}
One campaign.
PATCH /v1/campaigns/{id}
Change a campaign. Fields you leave out stay as they are.
Body, as JSON
| Field | Type | Notes |
|---|---|---|
title | string | at most 200 characters |
urls | array of strings | Pages on the campaign's site, one picked at random per visit: 1 on Free and Plus, up to 300 on Pro. |
durationS | integer | Seconds per visit: Free 30 to 60, Plus 30 to 300, Pro 30 to 600. |
countriesMode | one of "all", "only", "except" | Plus and Pro. "only" and "except" use the countries list. |
countries | array of strings | Two-letter country codes, such as "US". |
dailyCap | integer or null | Plus and Pro. Most visits a day; null for none. |
totalCap | integer or null | Plus and Pro. Most visits in all; the campaign ends there. |
endAt | date and time (ISO 8601) or null | Plus and Pro. The campaign ends at this time; null for none. |
busyHours | integer | Plus and Pro. A 24-bit mask of the hours visits may arrive, bit 0 for midnight to 1:00 in your time zone. 16777215 is every hour. |
delivery | one of "steady", "fast" | Plus and Pro. "steady" spreads the daily cap over the busy hours. |
repeatSpacingS | integer or null | Plus and Pro. Seconds before one viewer visits again, 300 to 259,200; null for 1 hour. |
hourlyMax | array of integers or null | Plus and Pro. 24 numbers, one per hour of your time zone from midnight: -1 for no visits that hour, 0 for no limit, or the most visits that hour, up to 100,000; null for none. Hours set to -1 and busyHours stay in step. |
hourlyMin | array of integers or null | Plus and Pro. 24 numbers: the campaign is offered first until that hour has that many visits, up to 600, never above the hour's maximum and never in a closed hour; null for none. |
minSpeedMbps | integer | Plus and Pro. The slowest connection a viewer may have, in Mbit/s, up to 1,000; 0 for any. A viewer that hasn't measured never passes. |
minCpuScore | integer | Plus and Pro. The lowest score from the viewer's own speed test, up to 1,000; 0 for any. A viewer that hasn't measured never passes. |
networkTypes | array of one of "home", "business", "vpn", "datacenter"s | Plus and Pro. Any of "home", "business", "vpn", "datacenter"; "home" and "business" only together. |
viewerPlatforms | array of one of "windows", "linux", "docker"s | Plus and Pro. Any of "windows", "linux" and "docker", the platform each viewer reports; at least one. A new campaign accepts all three, and a viewer that reports none of them visits only campaigns that accept all three. |
blockIps | array of strings | Plus and Pro. IPv4 addresses and ranges such as 203.0.113.0/24 that never visit, up to 500. |
blockAsns | array of integers | Plus and Pro. Network numbers that never visit, up to 500. |
blockMembers | array of strings | Plus and Pro. Member ids whose viewers never visit, up to 500. |
allowJavascript | boolean | Every plan. false loads the pages without their scripts. |
allowImages | boolean | Every plan. false loads the pages without pictures. |
allowCookies | boolean | Every plan. false sends and keeps no cookie. Every visit is wiped afterwards either way. |
DELETE /v1/campaigns/{id}
Archive a campaign. Its stats stay and its slot is freed.
POST /v1/campaigns/bulk
One action on up to 100 campaigns: run, pause, archive, restore, delete or reset_counts. Body: { action, ids }. Answers per campaign.
POST /v1/campaigns/{id}/archive
Archive a campaign and answer with it. Restore brings it back.
POST /v1/campaigns/{id}/restore
Restore an archived campaign, if a slot is free. A running one comes back paused.
POST /v1/campaigns/{id}/delete
Delete a campaign for good. It leaves both lists; its visits and points history stay.
POST /v1/campaigns/{id}/reset-counts
Restart the count the total cap uses. Total visits and stats are unchanged.
POST /v1/campaigns/{id}/pause
Pause a campaign.
POST /v1/campaigns/{id}/resume
Resume a paused campaign.
GET /v1/campaigns/{id}/stats
Visits by UTC hour or day, optionally by country; houseVisits and houseSeconds are each row's part from Hitlane's own viewers. Query: from, to, group=hour|day, by=country. Hourly rows are kept for 30 days: group=hour from earlier answers 422 hourly_range_too_old, and group=day counts days before them as whole UTC days.
Sites
GET /v1/sites
List your sites with their check status.
POST /v1/sites
Add any site. The automatic checks run at once; a site they refuse is not added.
Body, as JSON
| Field | Type | Notes |
|---|---|---|
host required | string | The site address, such as example.com or blog.example.com. |
POST /v1/sites/{id}/check
Run the automatic checks again on a site that hasn't passed them (once a minute).
DELETE /v1/sites/{id}
Remove a site. Its campaigns are archived.
Statistics
GET /v1/statistics/campaigns
Per campaign and UTC day, newest first: visits, points spent and countries; houseVisits is the part from Hitlane's own viewers. Only days with visits are listed. Query: days=7|30|90 (default 7; today is the last day).
GET /v1/statistics/earnings
Per UTC day, newest first: points from viewing and referrals, transfers in, transfers out with their fee, and points bought. Query: days=7|30|90 (default 7; today is the last day).
Viewers
GET /v1/viewers
Your live viewer sessions, with partial addresses, each one's platform (windows, linux, docker or other) and mode (desktop or server; null from a viewer that doesn't say).
Points
GET /v1/ledger
Your points history, newest first by the end of each row. Query: cursor, limit. Viewing earnings and visit charges come in 15-minute rows (refType bucket), and after 8 days in one row a day (refType day); entries counts the visits in a row, and periodEnd is when its period ends (null for a single movement).
GET /v1/ledger/today
Points earned by viewing and spent on visits since your local midnight.
Transfers
GET /v1/transfers
Your transfers, sent and received, newest first: the other member, amount, fee, net, message. Query: cursor, limit.
POST /v1/transfers
Send points to another member, by username or member id (Plus and Pro; accounts 30+ days old; 1,000 to 250,000 a day). A 10% fee leaves circulation; the recipient gets the rest. An optional message, up to 140 characters.
Body, as JSON
| Field | Type | Notes |
|---|---|---|
to | string | The member who receives the points: their username (with or without @) or member id. Give this or toUserId, not both. |
toUserId | string | The member id of the member who receives the points. Give this or to, not both. |
amount required | integer | At least 1,000, at most 250,000 a day. |
message | string | at most 140 characters |
Shop
GET /v1/shop
Your funds in US cents, the most they can hold ($2,000, checkouts still open counted: fundsLimitCents, reservedCents, roomCents), whether adding funds is open, whether the shop is paused, and your campaign slots (plan, extra, in use).
GET /v1/shop/history
Your funds history, newest first: top-ups and what each purchase bought. Query: cursor, limit.
GET /v1/shop/payments
Your top-ups, newest first, each with its state (pending, confirming, paid, expired, failed, cancelled, held or refunded) and the checkout's address while it can still be paid. Query: cursor, limit.
GET /v1/shop/payments/{id}
One of your top-ups and its state.
Notifications
GET /v1/notifications
Your newest 30 notifications, newest first, each with its kind, its details, when it arrived and when you read it, and how many are unread. Notifications are kept 90 days and never emailed.
Billing
GET /v1/billing
How paid plans are bought right now.
Status
GET /v1/status
Whether Hitlane is down for maintenance (and until when), and whether sign-ups, the shop and visits are open. No key needed. While maintenance is on, member and viewer calls answer 503 with the code maintenance and a Retry-After header. The health checks, this call, sign-in, GET /v1/account, the API description, the visit check tag and the payment webhook stay open.