Tomorrow.io Timelines API

Flexible timeline retrieval across any combination of fields and timesteps.

OpenAPI Specification

tomorrow-io-timelines-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Tomorrow.io Alerts Timelines API
  version: '4.0'
  description: 'Create, manage, and trigger weather-based alerts. Alerts evaluate Tomorrow.io

    weather data layers against custom thresholds for one or more linked locations

    and deliver notifications via webhook, email, and the Tomorrow.io app.

    '
  contact:
    name: Tomorrow.io Support
    url: https://support.tomorrow.io
servers:
- url: https://api.tomorrow.io/v4
  description: Tomorrow.io Production
security:
- apikeyAuth: []
tags:
- name: Timelines
  description: Flexible timeline retrieval across any combination of fields and timesteps.
paths:
  /timelines:
    get:
      tags:
      - Timelines
      summary: Retrieve Timelines (Basic)
      operationId: getTimelines
      description: 'Query weather, air quality, pollen, fire, and other data layers across an

        arbitrary time range and timestep with a simple query-string request.

        '
      parameters:
      - name: location
        in: query
        required: true
        schema:
          type: string
      - name: fields
        in: query
        required: true
        description: Comma separated list of data layer field names (e.g. temperature,windSpeed,precipitationIntensity).
        schema:
          type: string
      - name: startTime
        in: query
        schema:
          type: string
          format: date-time
      - name: endTime
        in: query
        schema:
          type: string
          format: date-time
      - name: timesteps
        in: query
        schema:
          type: string
      - name: units
        in: query
        schema:
          type: string
          enum:
          - metric
          - imperial
      - name: timezone
        in: query
        schema:
          type: string
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Timeline payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimelinesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
    post:
      tags:
      - Timelines
      summary: Retrieve Timelines (Advanced)
      operationId: postTimelines
      description: 'Advanced timelines request supporting polygon and polyline geometries,

        large field lists, and complex unit and timezone configuration in the

        request body.

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TimelinesRequest'
      parameters:
      - name: apikey
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Timeline payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimelinesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    TimelinesResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            timelines:
              type: array
              items:
                type: object
                properties:
                  timestep:
                    type: string
                  startTime:
                    type: string
                    format: date-time
                  endTime:
                    type: string
                    format: date-time
                  intervals:
                    type: array
                    items:
                      $ref: '#/components/schemas/TimelineInterval'
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        type:
          type: string
        message:
          type: string
    TimelineInterval:
      type: object
      properties:
        startTime:
          type: string
          format: date-time
        values:
          $ref: '#/components/schemas/WeatherValues'
    TimelinesRequest:
      type: object
      required:
      - location
      - fields
      - timesteps
      properties:
        location:
          oneOf:
          - type: string
            description: lat,lng or locationId
          - type: object
            description: GeoJSON Point/Polygon/LineString geometry
        fields:
          type: array
          items:
            type: string
        timesteps:
          type: array
          items:
            type: string
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        units:
          type: string
          enum:
          - metric
          - imperial
        timezone:
          type: string
    WeatherValues:
      type: object
      description: Subset of the 60+ Tomorrow.io data layers requested via the fields parameter.
      properties:
        temperature:
          type: number
          description: Air temperature in C or F depending on units.
        temperatureApparent:
          type: number
        humidity:
          type: number
        windSpeed:
          type: number
        windDirection:
          type: number
        windGust:
          type: number
        precipitationIntensity:
          type: number
        precipitationProbability:
          type: number
        precipitationType:
          type: integer
        cloudCover:
          type: number
        visibility:
          type: number
        pressureSurfaceLevel:
          type: number
        uvIndex:
          type: integer
        weatherCode:
          type: integer
          description: Tomorrow.io weather code (e.g. 1000 Clear, 4000 Drizzle, 5000 Snow).
        epaIndex:
          type: integer
        treeIndex:
          type: integer
        grassIndex:
          type: integer
        weedIndex:
          type: integer
  responses:
    RateLimited:
      description: Rate limit exceeded for the plan tier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apikeyAuth:
      type: apiKey
      in: query
      name: apikey