Skip to main content

Filtering & Querying

Learn how to filter and query API results to get exactly the data you need.

Query Parameters

Most endpoints support the following query parameters for filtering results:

ParameterTypeDescription
categorystringFilter by complaint category (e.g., "electrical", "engine")
year_fromintegerStart year for date range filter
year_tointegerEnd year for date range filter
limitintegerMaximum number of results (default: 20, max: 100)
offsetintegerNumber of results to skip for pagination

Filtering by Category

Filter complaints by category to focus on specific vehicle systems:

Filter by category
curl -X GET "https://api.drivedecision.com/v1/complaints/honda/civic/2023?category=electrical" \
  -H "Authorization: Bearer YOUR_API_KEY"

Date Range Filtering

Filter results by model year range:

Filter by year range
curl -X GET "https://api.drivedecision.com/v1/statistics/honda/civic?year_from=2020&year_to=2024" \
  -H "Authorization: Bearer YOUR_API_KEY"

Pagination

Use limit and offset for paginating large result sets:

Paginated request
# Get the second page of 20 results
curl -X GET "https://api.drivedecision.com/v1/complaints/honda/civic/2023?limit=20&offset=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Combining Filters

Combine multiple filters for precise queries:

Combined filters
curl -X GET "https://api.drivedecision.com/v1/complaints/honda/civic/2023?category=engine&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"