---
title: "Retrieve flight IDs based on a datetime range"
url: "https://developer.schiphol.nl/apis/schiphol-public-flight-api-4-public-prd/versions/7e467a47-1065-4998-b293-ef9bb4efbe24/operations/flightByIds"
---

> Full API specification: https://developer.schiphol.nl/apis/schiphol-public-flight-api-4-public-prd/versions/7e467a47-1065-4998-b293-ef9bb4efbe24.md

# Retrieve flight IDs based on a datetime range

`GET` `/flights/ids`

Operation ID: `flightByIds`

Returns a list of flight IDs for flights scheduled within the specified datetime range (filters on scheduleDateTime). Max date range is three days.

## Query parameters

- `fromDateTime` (string, local-date-time, required) - From date of search period. Format: yyyy-MM-dd'T'HH:mm:ss
- `toDateTime` (string, local-date-time, required) - To date of search period (inclusive). Format: yyyy-MM-dd'T'HH:mm:ss

## Header parameters

- `Accept` (string, required) - Only 'application/json' is allowed

## Responses

- `200` - List of flight IDs
- `400` - Invalid request parameters
- `500` - Internal server error

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Schiphol Public Flight API
  version: 4.2.0
servers:
  - url: https://{environment}.schiphol.nl/public/public-flights/v4
    variables:
      environment:
        enum:
          - api
          - api-acc
        default: api
paths:
  /flights/ids:
    get:
      summary: Retrieve flight IDs based on a datetime range
      description: Returns a list of flight IDs for flights scheduled within the
        specified datetime range (filters on scheduleDateTime). Max date range
        is three days.
      operationId: flightByIds
      parameters:
        - $ref: "#/components/parameters/AcceptHeader"
        - name: fromDateTime
          in: query
          description: "From date of search period. Format: yyyy-MM-dd'T'HH:mm:ss"
          required: true
          schema:
            type: string
            format: local-date-time
        - name: toDateTime
          in: query
          description: "To date of search period (inclusive). Format: yyyy-MM-dd'T'HH:mm:ss"
          required: true
          schema:
            type: string
            format: local-date-time
      responses:
        "200":
          description: List of flight IDs
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: "141988470640710484"
        "400":
          description: Invalid request parameters
        "500":
          description: Internal server error
security:
  - bearerAuth: []
components:
  parameters:
    AcceptHeader:
      name: Accept
      in: header
      description: Only 'application/json' is allowed
      required: true
      style: simple
      schema:
        type: string
        example: application/json
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```
