Skip to main content

ONIK API (v0)

Download OpenAPI specification:Download

V0 is a trial of the ONIK API to help us identify use cases, iterate the design, and work out the kinks. We'd love your help making improvements before the official release.

Authentication

Obtain an API key by contacting ONIK support. The x-api-key HTTP header is required for all requests.

Examples

Example: Authenticated Curl request

curl -X GET "https://api.onik.io/v0/sites" -H "x-api-key: YOUR_API_KEY"

Example: How has a site name ONIK been performing recently?

curl -X GET "https://api.onik.io/v0/scores/summary?siteName=Onik" -H "x-api-key: YOUR_API_KEY"

Results

    {
      "key": "Onik",
      "doc_count": 81,
      "min": 93,
      "avg": 93.7,
      "max": 95,
      "accessibility_max": 100,
      "accessibility_min": 92,
      "accessibility_avg": 95.5,
      "latest": [
        {
          ... The most recent Site Score Calculation
        }
      ]
      ...
    }

The fields avg, min, and max are the average, minimum, and maximum scores for the site over the period of time. Similarly, the accessibility_avg, accessibility_min, and accessibility_max fields represent the average, minimum, and maximum accessibility scores over the same period.

Example: How are all of my sites performing recently?

Similar to the previous example, but without the siteName parameter. This will return an array of summary scores for all sites in your account.

curl -X GET "https://api.onik.io/v0/scores/summary" -H "x-api-key: YOUR_API_KEY"

Sites

Sites are the primary way ONIK organizes website performance monitors. Sites have a name, url, and a series of settings which control how the site is monitored and audited. This section allows you to see all the sites in your account.

List sites

A list of the all the sites within your account and its settings

query Parameters
tag
string

Filter sites which have a specific tag

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Site by name or ID

Returns a specific site and its settings matched by site name or ID

Responses

Response samples

Content type
application/json
{
  • "id": "ac38426b-1a89-4458-9015-1fee84b887cf",
  • "name": "Onik",
  • "url": "Https://Onik.Io",
  • "service": "custom",
  • "regions": null,
  • "schedule": null,
  • "tags": [
    ],
  • "ignoreSSLValidationErrors": null,
  • "snoozeNotifications": null,
  • "perfCheckIntervalMinutes": null,
  • "startDate": null,
  • "endDate": null,
  • "paused": null,
  • "createdAt": "2024-01-25T20:22:29.323Z",
  • "updatedAt": "2024-10-24T01:49:57.178Z",
  • "_deleted": null,
  • "_lastChangedAt": 1729734597223
}

Scores

Scores represent a Site's Overall Health rated out of 100, and is the same scores shown in the ONIK App Interface and Site Scorecard. This score takes into account all of the performance metrics across aSite's monitored pages. Site Score's are recalculated every 2 hours, and cover a period of the previous 7 days.

The Weighted Score combines the following metrics: - Uptime / Downtime - Response Time - Performance Score and Core Web Vitals (LCP, FCP, TBT, CLS)

Response times are in microseconds.

Divide by 1,000,000 to convert to seconds. Example: 195183 microseconds is 0.195183 seconds.

List of Site Summary scores

Aggregates the Site Scores by site over a period of time

Authorizations:
x-api-key
query Parameters
startDate
string

2024-01-01T00:00:000Z (Default: 7 days ago)

endDate
string

2024-01-01T00:00:000Z (Default: now)

dateField
string

endDate (Default: endDate)

size
integer

size (Default: 10)

tag
string

Filter sites which have a specific tag

Responses

Response samples

Content type
application/json
{
  • "startDate": "2024-11-27T19:16:46.202Z",
  • "endDate": "2024-12-04T19:16:46.202Z",
  • "dateField": "timestamp",
  • "summary": [
    ]
}

Specific Site's Summary Scores

Aggregates the Site Scores by site over a period of time

Authorizations:
x-api-key
path Parameters
siteName
required
string

name of the site

query Parameters
startDate
string

2024-01-01T00:00:000Z (Default: 7 days ago)

endDate
string

2024-01-01T00:00:000Z (Default: now)

dateField
string

endDate (Default: endDate)

size
integer

size (Default: 10)

Responses

Response samples

Content type
application/json
{
  • "value": {
    }
}

List all site scores

Authorizations:
x-api-key
query Parameters
startDate
string

2024-01-01T00:00:000Z (Default: 7 days ago)

endDate
string

2024-01-01T00:00:000Z (Default: now)

dateField
string

endDate (Default: endDate)

size
integer

size (Default: 10)

tag
string

Filter sites which have a specific tag

Responses

Response samples

Content type
application/json
{
  • "startDate": "2024-11-27T19:16:46.202Z",
  • "endDate": "2024-12-04T19:16:46.202Z",
  • "dateField": "timestamp",
  • "aggregations": {
    },
  • "results": [
    ]
}

List a site's scores

Site scores for a specific site.

Authorizations:
x-api-key
path Parameters
siteName
required
string

name of the site

query Parameters
startDate
string

2024-01-01T00:00:000Z (Default: 7 days ago)

endDate
string

2024-01-01T00:00:000Z (Default: now)

dateField
string

endDate (Default: endDate)

size
integer

size (Default: 10)

Responses

Response samples

Content type
application/json
{
  • "startDate": "2024-11-27T19:16:46.202Z",
  • "endDate": "2024-12-04T19:16:46.202Z",
  • "dateField": "timestamp",
  • "aggregations": {
    },
  • "results": [
    ]
}