How filtering works
Learn how to filter and sort results using date ranges and parameters.
The API supports filtering results using various query parameters. You can filter by date ranges, sort order, and combine multiple parameters to get exactly the data you need.Common filtering examples
All data for a campaign in descending order (most recent first)
To retrieve all campaign results sorted by the most recent first, pass thesort parameter with the value desc. This is ideal for displaying the latest results at the top of your dashboard or reports.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forsort=desc- Sort results in descending order (newest to oldest)
All data for a campaign in ascending order (oldest first)
To retrieve all campaign results sorted from oldest to newest, pass thesort parameter with the value asc. This is useful for processing historical data chronologically or performing incremental syncs.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forsort=asc- Sort results in ascending order (oldest to newest)
Data before a specific date
To get all results up to a certain date, use theend_date parameter. This will return all data from the beginning up to and including the specified date. Combine with sort=desc to see the most recent data within that range first.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forend_date=2024-01-01- Return data up to and including January 1, 2024sort=desc- Show most recent results first within the date range
Data after a specific date
To get all results from a specific date onwards, use thestart_date parameter. This will return all data from the specified date through the current date. Perfect for getting recent data or data since a last sync point.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forstart_date=2024-06-01- Return data from June 1, 2024 onwardssort=desc- Show most recent results first
Data between two dates in descending order
To get results for a specific date range with the most recent first, use bothstart_date and end_date parameters along with sort=desc. This is ideal for generating reports for a specific time period.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forstart_date=2024-07-01- Start of the date range (July 1, 2024)end_date=2024-09-30- End of the date range (September 30, 2024)sort=desc- Show most recent results first within the range
Data between two dates in ascending order
To get results for a specific date range in chronological order, use bothstart_date and end_date parameters with sort=asc. This is useful for processing data sequentially or building time-series visualizations.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forstart_date=2024-07-01- Start of the date range (July 1, 2024)end_date=2024-09-30- End of the date range (September 30, 2024)sort=asc- Show oldest results first within the range
Advanced filtering examples
Month-end reporting
For comprehensive monthly reports, combine date range filtering with a higher result limit. Set bothstart_date and end_date to the first and last day of the month, use sort=desc to show recent activity first, and increase the limit to retrieve more results per page.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- The specific campaign to retrieve results forstart_date=2024-09-01- First day of the month (September 1, 2024)end_date=2024-09-30- Last day of the month (September 30, 2024)sort=desc- Show most recent results firstlimit=100- Retrieve up to 100 results per page (default is 20)
Incremental data sync
For syncing new data since your last fetch, filter by a specific campaign and start date. Usesort=asc to process results chronologically, starting from your last sync point. The higher limit ensures you can fetch more data in a single request.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- Filter to a specific campaignstart_date=2024-10-20- Only fetch data from October 20, 2024 onwardssort=asc- Process data chronologically from oldest to newestlimit=100- Fetch more results per page to reduce number of API calls
Single day’s data
To retrieve all results for a specific day, set bothstart_date and end_date to the same date. This is useful for daily reports or investigating activity on a particular date. Combine with campaign_id to narrow down to a specific campaign.
Parameters:
campaign_id=123e4567-e89b-12d3-a456-426614174000- Filter to a specific campaignstart_date=2024-10-15- Target date (October 15, 2024)end_date=2024-10-15- Same as start_date to get only this day’s data
Parameters
Sort order for results. Use
asc for ascending order (oldest first) or desc
for descending order (most recent first).Filter results to include only data from this date onwards. Format:
YYYY-MM-DDFilter results to include only data up to and including this date. Format:
YYYY-MM-DDFilter results to a specific campaign by providing the campaign UUID.
A limit on the number of objects to be returned. Limit can range between 1 and
100, and the default is 20.
Tips
- Combine
start_dateandend_dateto get data for a specific date range - Use
sort=descfor the most recent data first, which is useful for dashboards and reporting - Use
sort=ascfor incremental syncs to process data in chronological order - Set
start_dateandend_dateto the same value to get data for a single day

