Developers

Explore our API documentation.

Stats
Manage the stats.
Websites
Manage the websites.
Account
Manage the account.

How the BYOViral API works

The REST API gives you the same data as your dashboard, in JSON: the stats of each website (pages, referrers, search engines, countries, browsers, devices and more), the websites on your account, and your account details. Use it to pull numbers into a spreadsheet, a client report, a status board or your own app.

Basics

  • Base URL: https://www.byoviral.com/api/v1/
  • Authentication: send your API key as a Bearer token in the Authorization header. Find the key on your API page.
  • Format: responses are JSON. Send Accept: application/json with every request.
  • Rate limit: 120 requests a minute per account. Above that the API answers 429 Too Many Requests until the minute resets.
  • Health check: GET /api/v1/status needs no key and answers {"message":"Online.","status":200}.

Endpoints

  • Stats: GET /api/v1/stats/{website_id} returns one report for a website, chosen with name, for the dates in from and to, with search, sorting and paging.
  • Websites: list, add, read, update and delete the websites on your account.
  • Account: GET /api/v1/account returns the account the key belongs to.

Keep the key secret: it has the same access as your login. Call the API from your server or a scheduled script, never from JavaScript that visitors can read in their browser. If a key leaks, generate a new one on the API page and the old one stops working.