Last updated

Cars filtering and pagination

Learn how to filter your car rental search results and organise payload with pagination.


Car rental filters

Demand API offers a range of filters to help you refine car rental search results based on various criteria.

The main filter is the payment timing.

To apply filters, include specific query parameters in your cars/search request.

Payment timing

You can restrict results to include car rentals that support only pay_local and/or online payments (including pay_now or part_pay ).

Example of car rental search request for online payment timings:

{
    "booker": {
        "country": "us"
    },
    "currency": "USD",
    "driver": {
        "age": 35
    },
    "route": {
        "pickup": {
            "datetime": "2025-07-21T10:00:00",
            "location": {
                "airport": "LAX"
            }
        },
        "dropoff": {
            "datetime": "2025-07-24T10:00:00",
            "location": {
                "airport": "LAX"
            }
        }
    },
    "payment": {
        "timings": ["pay_now", "part_pay"]
    }
}

Refer to Payment timings section for more details about online payments.


Pagination

Pagination in our API is handled using standard mechanisms such as page and maximum_results parameters.

  • page: This parameter indicates the pagination token of the result set, and it can be used to retrieve subsequent pages.
  • maximum_results: Sets the maximum number of results per page, defaulting to 100 if not specified.

Example os search request with maximum_results:

{
    "booker": {
      "country": "nl"
    },
    "currency": "EUR",
    "driver": {
      "age": 36
    },
    "route": {
      "dropoff": {
        "datetime": "2025-05-08T11:05:00",
        "location": {
          "coordinates": {
            "latitude": 52.309456,
            "longitude": 4.762266
          }
        }
      },
      "pickup": {
        "datetime": "2025-05-20T11:05:00",
        "location": {
          "coordinates": {
            "latitude": 52.309456,
            "longitude": 4.762266
          }
        }
      },
      "maximum_results": 100
    }
  }'

Pagination allows you to handle larger data sets by fetching smaller, more manageable chunks, improving both performance and user experience.

Example of request response with pagination token (next_page):

{
  "request_id": "01h00fr9y7qkbxtc6kyv97j49z",
  "data": [
    {
      "car": 122655,
      "policies": {
        "cancellation": {...}
        },
        "fuel": "return_same",
        "mileage": {...},
        "payment": {
          "timing": "pay_now"
        }
      },
      "price": {
        "total": "50.00",
        "currency": "EUR"
      },
      "route": {
        "dropoff": {
          "depot": 112314
        },
        "pickup": {
          "depot": 112314
        }
      },
      "supplier": 7455,
      "url": {
        "app": "booking://page",
        "web": "https://example.com"
      }
    }
  ],
  "metadata": {
    "next_page": "eyJhbGciOiJIUzI1NiJ9.eyJwIjp7Im1heGltdW1fcmVzdWx0cyI6MTAsIm9mZnNldCI6MTB9LCJhdWQiOiJDQVJTX1NVUFBMSUVSUyIsImV4cCI6MTY4MzY0NzMwNX0.y7NmH48mm7lImd2WxsHdotj6n-dVQAzJCGCnIJCKy3A",
    "total_results": 122
  }
}

Sorting

Use "sort.by" option to organise the results on each page based on various criteria.

Available sorting options include: distance, price and review_score.

Example for sorting by "price" request:

{
  "booker": {
    "country": "nl"
  },
  "currency": "EUR",
  "driver": {
    "age": 36
  },
  "sort": {
    "by": "price"
  },
  "route": {
    "dropoff": {
      "datetime": "2025-06-05T11:05:00",
      "location": {
        "airport": "AMS"
      }
    },
    "pickup": {
      "datetime": "2025-05-05T16:05:00",
      "location": {
        "airport": "AMS"
      }
    }
  }
}

Best practices

Combine filters with pagination parameters to effectively navigate through large datasets.

By combining these filters in your API requests, you can refine the search results to match specific criteria.


Curious to know more?