---
title: "Batch weather requests"
method: POST
path: "/api/v1/weather/batch"
---

# Batch weather requests

`POST /api/v1/weather/batch`

## Request

- Base URL: `https://api.virga.dev`
- URL: `https://api.virga.dev/api/v1/weather/batch`
- Auth: API key in header `X-API-Key`

Fetch weather for multiple locations in a single request. Max 25 locations. Credit cost is the sum of individual costs.

## Request body

- object
  - `requests` object[], required
    - `lat` number, required
    - `lon` number, required
    - `endpoint` 'current' | 'forecast/hourly' | 'forecast/daily' | 'historical'

## Response `200`

Batch results

- object
  - `results` object[]
  - `meta` Meta
    - `source` string
    - `upstreamTimestamp` string, date-time
    - `cacheTTL` integer: Cache TTL in seconds
    - `cached` boolean
    - `confidence` number
    - `creditsCost` integer
    - `creditsRemaining` integer
    - `environment` 'stage' | 'production'
    - `rateLimitRemaining` integer
    - `rateLimitReset` integer: Unix timestamp

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `402`: Insufficient credits
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/virga/apis/virga-api.md) · [All operations](https://skmtc.dev/virga/apis/virga-api/llms.txt) · [OpenAPI document](https://skmtc.dev/virga/apis/virga-api/revisions/5f5b639b1da3?raw)
