GET /v1/coverage

Returns the available data date ranges stored in the database. Use this endpoint to check what history exists before making a /v1/history request, especially for less common instruments.


Request

GET /v1/coverage

Auth: Required

Query Parameters

ParameterTypeRequiredDescription
symbolstring❌Compound key. If omitted, returns coverage for all symbols accessible to your key.

Response — Single Symbol

{
  "symbol": "WMMARKETS:ZERO:EURUSD",
  "coverage": [
    {
      "from": 1740960000,
      "to":   1749600000
    }
  ]
}

Response — All Symbols

{
  "coverage": {
    "WMMARKETS:ZERO:EURUSD": [
      { "from": 1740960000, "to": 1749600000 }
    ],
    "WMMARKETS:ZERO:GBPUSD": [
      { "from": 1740960000, "to": 1749600000 }
    ],
    "WMMARKETS:ZERO:XAUUSD": [
      { "from": 1740960000, "to": 1749600000 }
    ]
  }
}

Each entry in the coverage array is a contiguous data range. Multiple entries indicate gaps in the data (e.g. after a server outage period).


Response Fields

FieldTypeDescription
coverage[].fromintegerStart of data range (Unix epoch seconds)
coverage[].tointegerEnd of data range (Unix epoch seconds)

Example — Check Before Fetching History

import requests
from datetime import datetime, timezone

headers = {"X-API-Key": "fxd_your_key"}
BASE = "https://api.pipdata.net"

# Check coverage first
cov = requests.get(
    f"{BASE}/v1/coverage",
    headers=headers,
    params={"symbol": "WMMARKETS:ZERO:EURUSD"}
).json()

if cov["coverage"]:
    start = datetime.fromtimestamp(cov["coverage"][0]["from"], tz=timezone.utc)
    end   = datetime.fromtimestamp(cov["coverage"][0]["to"],   tz=timezone.utc)
    print(f"Data available from {start.date()} to {end.date()}")

    # Now safely fetch within that range
    resp = requests.get(
        f"{BASE}/v1/history",
        headers=headers,
        params={
            "symbol": "WMMARKETS:ZERO:EURUSD",
            "resolution": "60",
            "from": cov["coverage"][0]["from"],
            "to":   cov["coverage"][0]["to"]
        }
    )
    data = resp.json()
    print(f"Fetched {data.get('meta', {}).get('bar_count', 0)} bars")
else:
    print("No data available for this symbol")

Error Codes

HTTP StatusCodeDescription
401UNAUTHORIZEDAPI key missing or invalid
403SYMBOL_NOT_PERMITTEDFeed access not allowed
404SYMBOL_NOT_FOUNDSymbol does not exist
500SERVER_ERRORInternal error