Using the API
This document goes into more detail about the various operations you can perform with the API.
When making an API request, you usually don't receive all of the results of that request in a single response. This is because some responses could contain thousands of objects so most responses are paginated by default.
Cursor-based pagination is the most efficient method of paging and should always be used when possible. A cursor refers to a random string of characters which marks a specific item in a list of data. The cursor will always point to the item, however it will be invalidated if the item is deleted or removed. Therefore, your app shouldn't store cursors or assume that they will be valid in the future.
When reading an edge that supports cursor pagination, you see the the following JSON responses:
"data": [ ... data ],
"data": [ ... data ],
A cursor-paginated edge supports the following parameters:
limit : This is the maximum number of objects that may be returned. A query may return fewer than the value of limit due to filtering.
totalCount : This is the total amount of records returned by the query.
totalPages : This is the total amount of pages returned by the query.
previous*: The API endpoint that will return the previous page of data.
next : The API endpoint that will return the next page of data. If not included, this is the last page of data. Stop paging when the next link no longer appears.
*Only returned for Schedules API.
Health Check API
The Health APIs are public endpoints that give information on each service's health.
The following are examples of requests to Health Check API:
Depending on the service health status the following responses can be returned:
HTTP Status 200 OK
HTTP Status 503 Service Unavailable
Sample 200 OK response (Flight Info API):
Sample 503 Service Unavailable response (Schedules API):
Cross-Origin Resource Sharing (CORS)
Cross-Origin Resource Sharing (CORS) is generally not allowed in most APIs and web services due to security concerns. This includes the APIs provided by OAG. To integrate the API, it’s recommended to use a server-side approach. Enabling CORS on the front-end could expose your subscription key to the public and allow others to misuse it.
API version life cycle
After the launch of a subsequent version, a version will be retired approximately one year later. For instance, if API version v2 is released on April 30th, 2023, v1 will be decommissioned on May 1st, 2024. It is important to note that a version will be flagged as deprecated once the next version is released.
A deprecated API version will start returning two new headers: "Deprecation" and "Sunset" with the date when the API will no longer be available.
Have a question? The OAG knowledge base is full of frequently asked questions, how-to guides, and product documentation, designed to make it quick and easy for you to access information, regarding integrating and using the OAG APIs. You can access our Knowledge Base here.