To ensure optimal performance and a reliable integration experience when using AnyRoad APIs, we recommend the following best practices for polling and querying data.
Polling Strategy: Favor Small, Frequent Increments
Rather than querying large historical data sets over extensive date ranges (e.g., six months or more), we strongly recommend that integrations retrieve data in smaller, incremental time windows.
Best Practice: Query for recent changes over short periods (e.g., the past hour or past day) based on the polling frequency your integration requires.
Avoid: Fetching the full historical dataset repeatedly, which can lead to degraded performance, increased API latency, and timeouts.
This approach not only improves the responsiveness of your integration but also reduces load on your systems and ours.
Frequency Recommendations
Standard integrations: Poll once per day ideally (once per hour can work if the date range is short enough) for newly updated or created records. Ensuring filter parameters are as narrow as possible for date ranges and ‘updated’ filters will improve performance.
High-frequency needs: For applications that require near real-time synchronization, the preferred method is to take advantage of our native webhooks on the AnyRoad platform that give you near real time notifications of events taking place on the AnyRoad platform with all of the relevant associated data. If you absolutely do need to poll for data at a high frequency, polling at more frequent intervals is acceptable provided that you continue to limit the requested date ranges appropriately.
Minimize Full History Requests
Full historical data pulls should be reserved for exceptional circumstances, such as initial data migrations or re-synchronizations after an outage. If a full export is necessary, consider batching the request into multiple smaller queries segmented by date ranges to reduce server load and improve reliability.
Leverage Filtering Parameters
Most AnyRoad API endpoints support filtering parameters, like date ranges, requesting only records tha that have been updated, etc. Using these filters ensures that your queries are efficient and focused only on newly relevant data. By utilizing these filters, your integration minimizes unnecessary data transfer and processing.
Understand API Data Latency
Please note that some APIs, such as the Bookings API, may introduce a small natural delay before newly created or updated records become available. Polling at high frequency will not bypass this latency and may result in redundant requests if not properly accounted for.
Webhooks
AnyRoad has in webhook-based integrations, which will offer customers a more efficient, event-driven alternative to polling.
We encourage customers with high-frequency or near-real-time needs to consider migrating to webhooks once available.
Summary
Good Practice | Poor Practice |
Polling small time windows | Querying large six-month date ranges |
Using filters | Requesting full data set repeatedly |
Scheduled polling once per hour/day for large unfiltered datasets | Constant polling without data change logic, or switching to webhooks for frequent data needs |