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
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | ❌ | 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
| Field | Type | Description |
|---|---|---|
coverage[].from | integer | Start of data range (Unix epoch seconds) |
coverage[].to | integer | End 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 Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | API key missing or invalid |
| 403 | SYMBOL_NOT_PERMITTED | Feed access not allowed |
| 404 | SYMBOL_NOT_FOUND | Symbol does not exist |
| 500 | SERVER_ERROR | Internal error |