Ir a la app

This guide walks you through getting an API token, making your first request, and interpreting the response.

Prerequisites

  • A PASTOR API token. Request access at developers@pastormap.com.
  • An HTTP client (curl, Insomnia, Postman, or any HTTP library in your language of choice).

Step 1: Get your API token

Contact the PASTOR team at developers@pastormap.com to request API access. Include a brief description of your use case and the municipalities you need to query. Once provisioned, you will receive a bearer token.

Store the token in an environment variable, never in source code:

export PASTOR_API_KEY=your_token_here

Step 2: Make your first request

Fetch daily wildfire risk data for a municipality using its INE code:

curl -s "https://api.pastormap.com/api/v3/m1?municipio_id=05001&date_from=2025-07-01&date_to=2025-07-28" \
  -H "Authorization: Bearer $PASTOR_API_KEY"

Step 3: Inspect the response

A successful response returns a JSON object with the risk score and label for the requested municipality and date:

{
  "municipio_id": "05001",
  "date": "2025-07-28",
  "risk_score": 0.23,
  "risk_label": "MEDIUM"
}

risk_score is a float between 0 and 1. risk_label is one of LOW, MEDIUM, or HIGH.

Step 4: Query a date range

Pass date_from and date_to (both in YYYY-MM-DD format) to retrieve risk data across a period:

curl -s "https://api.pastormap.com/api/v3/m1?municipio_id=05001&date_from=2025-06-28&date_to=2025-07-28" \
  -H "Authorization: Bearer $PASTOR_API_KEY"

Next steps