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.
Obtain an API key by contacting ONIK support. The x-api-key HTTP header is required for all requests.
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 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
- 200
- 401
- 403
[- {
- "id": "ac38426b-1a89-4458-9015-1fee84b887cf",
- "name": "Onik",
- "url": "Https://Onik.Io",
- "service": "custom",
- "regions": null,
- "schedule": null,
- "tags": [
- null
], - "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
}
]Response samples
- 200
- 401
- 403
- 404
{- "id": "ac38426b-1a89-4458-9015-1fee84b887cf",
- "name": "Onik",
- "url": "Https://Onik.Io",
- "service": "custom",
- "regions": null,
- "schedule": null,
- "tags": [
- null
], - "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 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:
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
- 200
- 401
- 403
- 404
{- "startDate": "2024-11-27T19:16:46.202Z",
- "endDate": "2024-12-04T19:16:46.202Z",
- "dateField": "timestamp",
- "summary": [
- {
- "key": "Onik",
- "doc_count": 81,
- "min": 93,
- "avg": 93.71604938271605,
- "max": 95,
- "accessibility_max": 100,
- "extended_stats_weightedScore": {
- "count": 81,
- "min": 93,
- "max": 95,
- "avg": 93.71604938271605,
- "sum": 7591,
- "sum_of_squares": 711419,
- "variance": 0.2527053802774322,
- "variance_population": 0.2527053802774322,
- "variance_sampling": 0.2558641975309001,
- "std_deviation": 0.5026981005309571,
- "std_deviation_population": 0.5026981005309571,
- "std_deviation_sampling": 0.5058302062262594,
- "std_deviation_bounds": {
- "upper": 94.72144558377796,
- "lower": 92.71065318165414,
- "upper_population": 94.72144558377796,
- "lower_population": 92.71065318165414,
- "upper_sampling": 94.72770979516856,
- "lower_sampling": 92.70438897026354
}
}, - "accessibility_min": 92,
- "accessibility_avg": 95.53086419753086,
- "latest": [
- {
- "uptimePercent": 100.0000000001,
- "performanceComponentScore": 92.72727272727272,
- "responseTimeComponentScore": 97.85266275508783,
- "responseTimeAggs": {
- "min": 39246,
- "avg": 128652.07040841895,
- "max": 2076403
}, - "downtimeAggs": {
- "total": 0,
- "up": 3991,
- "down": 0
}, - "performanceAggs": {
- "cls_avg_score": 0,
- "bestpractice_min_score": 100,
- "seo_max_score": 100,
- "fcp_avg_score": 260.27272727272725,
- "performance_min_score": 81,
- "accessibility_avg_score": 95.63636363636364,
- "tbt_avg_score": 164.0909090909091,
- "si_max_score": 523,
- "seo_avg_score": 95.63636363636364,
- "lcp_max_score": 1098,
- "si_min_score": 322,
- "performance_avg_score": 94.9090909090909,
- "tbt_min_score": 8,
- "bestpractice_max_score": 100,
- "si_avg_score": 389.1818181818182,
- "lcp_min_score": 328,
- "seo_min_score": 92,
- "bestpractice_avg_score": 100,
- "cls_min_score": 0,
- "accessibility_max_score": 100,
- "cls_max_score": 0,
- "performance_max_score": 100,
- "fcp_min_score": 246,
- "tbt_max_score": 419,
- "lcp_avg_score": 556.6363636363636,
- "fcp_max_score": 299,
- "accessibility_min_score": 92
}, - "downtimeComponentScore": 100,
- "weightedScore": 95,
- "tenant": "tenant",
- "tenantId": "428xxxxxxx13",
- "siteId": "ac38xxxxxxxx887cf",
- "site": "Site",
- "timestamp": "2024-11-25T02:18:27.261Z",
- "startDate": "2024-11-18T00:00:00.000Z",
- "endDate": "2024-11-25T02:15:22.801Z",
- "type": "sitescore",
- "periodDays": 7,
- "id": "tenant_site_2024-11-25T02:15:22.801Z_7",
- "meta_data": [ ]
}
]
}
]
}Specific Site's Summary Scores
Aggregates the Site Scores by site over a period of time
Authorizations:
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
- 200
- 401
- 403
- 404
{- "value": {
- "startDate": "2024-11-27T19:16:46.202Z",
- "endDate": "2024-12-04T19:16:46.202Z",
- "dateField": "timestamp",
- "summary": [
- {
- "key": "Onik",
- "doc_count": 81,
- "min": 93,
- "avg": 93.71604938271605,
- "max": 95,
- "accessibility_max": 100,
- "extended_stats_weightedScore": {
- "count": 81,
- "min": 93,
- "max": 95,
- "avg": 93.71604938271605,
- "sum": 7591,
- "sum_of_squares": 711419,
- "variance": 0.2527053802774322,
- "variance_population": 0.2527053802774322,
- "variance_sampling": 0.2558641975309001,
- "std_deviation": 0.5026981005309571,
- "std_deviation_population": 0.5026981005309571,
- "std_deviation_sampling": 0.5058302062262594,
- "std_deviation_bounds": {
- "upper": 94.72144558377796,
- "lower": 92.71065318165414,
- "upper_population": 94.72144558377796,
- "lower_population": 92.71065318165414,
- "upper_sampling": 94.72770979516856,
- "lower_sampling": 92.70438897026354
}
}, - "accessibility_min": 92,
- "accessibility_avg": 95.53086419753086,
- "latest": [
- {
- "uptimePercent": 100.0000000001,
- "performanceComponentScore": 92.72727272727272,
- "responseTimeComponentScore": 97.85266275508783,
- "responseTimeAggs": {
- "min": 39246,
- "avg": 128652.07040841895,
- "max": 2076403
}, - "downtimeAggs": {
- "total": 0,
- "up": 3991,
- "down": 0
}, - "performanceAggs": {
- "cls_avg_score": 0,
- "bestpractice_min_score": 100,
- "seo_max_score": 100,
- "fcp_avg_score": 260.27272727272725,
- "performance_min_score": 81,
- "accessibility_avg_score": 95.63636363636364,
- "tbt_avg_score": 164.0909090909091,
- "si_max_score": 523,
- "seo_avg_score": 95.63636363636364,
- "lcp_max_score": 1098,
- "si_min_score": 322,
- "performance_avg_score": 94.9090909090909,
- "tbt_min_score": 8,
- "bestpractice_max_score": 100,
- "si_avg_score": 389.1818181818182,
- "lcp_min_score": 328,
- "seo_min_score": 92,
- "bestpractice_avg_score": 100,
- "cls_min_score": 0,
- "accessibility_max_score": 100,
- "cls_max_score": 0,
- "performance_max_score": 100,
- "fcp_min_score": 246,
- "tbt_max_score": 419,
- "lcp_avg_score": 556.6363636363636,
- "fcp_max_score": 299,
- "accessibility_min_score": 92
}, - "downtimeComponentScore": 100,
- "weightedScore": 95,
- "tenant": "tenant",
- "tenantId": "428xxxxxxx13",
- "siteId": "ac38xxxxxxxx887cf",
- "site": "Site",
- "timestamp": "2024-11-25T02:18:27.261Z",
- "startDate": "2024-11-18T00:00:00.000Z",
- "endDate": "2024-11-25T02:15:22.801Z",
- "type": "sitescore",
- "periodDays": 7,
- "id": "tenant_site_2024-11-25T02:15:22.801Z_7",
- "meta_data": [ ]
}
]
}
]
}
}List all site scores
Authorizations:
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
- 200
- 401
- 403
- 404
{- "startDate": "2024-11-27T19:16:46.202Z",
- "endDate": "2024-12-04T19:16:46.202Z",
- "dateField": "timestamp",
- "aggregations": {
- "min": 0,
- "avg": 66.81657848324515,
- "max": 99,
- "accessibility_max": 100,
- "accessibility_min": 62,
- "accessibility_avg": 87.51041474654377
}, - "results": [
- {
- "uptimePercent": 100.0000000001,
- "performanceComponentScore": 74.52380952380952,
- "responseTimeComponentScore": 85.35403447172123,
- "responseTimeAggs": {
- "min": 195183,
- "avg": 353627.37950901804,
- "max": 2020361
}, - "downtimeAggs": {
- "total": 0,
- "up": 3992,
- "down": 0
}, - "performanceAggs": {
- "cls_avg_score": 0.0479618962284197,
- "bestpractice_min_score": 100,
- "seo_max_score": 85,
- "fcp_avg_score": 821,
- "performance_min_score": 63,
- "accessibility_avg_score": 86,
- "tbt_avg_score": 17.5,
- "si_max_score": 3551,
- "seo_avg_score": 85,
- "lcp_max_score": 5974,
- "si_min_score": 1720,
- "performance_avg_score": 82.16666666666667,
- "tbt_min_score": 0,
- "bestpractice_max_score": 100,
- "si_avg_score": 2384,
- "lcp_min_score": 1444,
- "seo_min_score": 85,
- "bestpractice_avg_score": 100,
- "cls_min_score": 0.00012165832595201209,
- "accessibility_max_score": 86,
- "cls_max_score": 0.12844698131084442,
- "performance_max_score": 92,
- "fcp_min_score": 807,
- "tbt_max_score": 53,
- "lcp_avg_score": 2976,
- "fcp_max_score": 850,
- "accessibility_min_score": 86
}, - "downtimeComponentScore": 100,
- "weightedScore": 79,
- "tenant": "tenant1",
- "tenantId": "428e8xxxxxx13",
- "siteId": "ba65xxxxxxx7a",
- "site": "site",
- "timestamp": "2024-11-25T02:18:23.754Z",
- "startDate": "2024-11-18T00:00:00.000Z",
- "endDate": "2024-11-25T02:15:22.801Z",
- "type": "sitescore",
- "periodDays": 7,
- "id": "tenant_site_2024-11-25T02:15:22.801Z_7",
- "meta_data": [ ]
}
]
}List a site's scores
Site scores for a specific site.
Authorizations:
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
- 200
- 401
- 403
- 404
{- "startDate": "2024-11-27T19:16:46.202Z",
- "endDate": "2024-12-04T19:16:46.202Z",
- "dateField": "timestamp",
- "aggregations": {
- "min": 0,
- "avg": 66.81657848324515,
- "max": 99,
- "accessibility_max": 100,
- "accessibility_min": 62,
- "accessibility_avg": 87.51041474654377
}, - "results": [
- {
- "uptimePercent": 100.0000000001,
- "performanceComponentScore": 74.52380952380952,
- "responseTimeComponentScore": 85.35403447172123,
- "responseTimeAggs": {
- "min": 195183,
- "avg": 353627.37950901804,
- "max": 2020361
}, - "downtimeAggs": {
- "total": 0,
- "up": 3992,
- "down": 0
}, - "performanceAggs": {
- "cls_avg_score": 0.0479618962284197,
- "bestpractice_min_score": 100,
- "seo_max_score": 85,
- "fcp_avg_score": 821,
- "performance_min_score": 63,
- "accessibility_avg_score": 86,
- "tbt_avg_score": 17.5,
- "si_max_score": 3551,
- "seo_avg_score": 85,
- "lcp_max_score": 5974,
- "si_min_score": 1720,
- "performance_avg_score": 82.16666666666667,
- "tbt_min_score": 0,
- "bestpractice_max_score": 100,
- "si_avg_score": 2384,
- "lcp_min_score": 1444,
- "seo_min_score": 85,
- "bestpractice_avg_score": 100,
- "cls_min_score": 0.00012165832595201209,
- "accessibility_max_score": 86,
- "cls_max_score": 0.12844698131084442,
- "performance_max_score": 92,
- "fcp_min_score": 807,
- "tbt_max_score": 53,
- "lcp_avg_score": 2976,
- "fcp_max_score": 850,
- "accessibility_min_score": 86
}, - "downtimeComponentScore": 100,
- "weightedScore": 79,
- "tenant": "tenant1",
- "tenantId": "428e8xxxxxx13",
- "siteId": "ba65xxxxxxx7a",
- "site": "site",
- "timestamp": "2024-11-25T02:18:23.754Z",
- "startDate": "2024-11-18T00:00:00.000Z",
- "endDate": "2024-11-25T02:15:22.801Z",
- "type": "sitescore",
- "periodDays": 7,
- "id": "tenant_site_2024-11-25T02:15:22.801Z_7",
- "meta_data": [ ]
}
]
}