> ## Documentation Index
> Fetch the complete documentation index at: https://docs.marketdataset.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# cURL

> Using MarketDataset API with cURL

## Basic request

```bash theme={null}
curl "https://api.marketdataset.ai/forex/prices?pair=EURUSD&interval=hour&limit=5" \
  -H "X-API-KEY: sk_your_key"
```

## With date range

```bash theme={null}
curl "https://api.marketdataset.ai/forex/prices?pair=GBPUSD&interval=day&start_date=2024-01-01&end_date=2024-03-31" \
  -H "X-API-KEY: sk_your_key"
```

## Crypto funding rates

```bash theme={null}
curl "https://api.marketdataset.ai/crypto/funding-rates?symbol=BTCUSDT&limit=24" \
  -H "X-API-KEY: sk_your_key"
```

## Economic calendar (high impact USD events)

```bash theme={null}
curl "https://api.marketdataset.ai/macro/calendar?country=US&impact=high&limit=10" \
  -H "X-API-KEY: sk_your_key"
```

## COT reports

```bash theme={null}
curl "https://api.marketdataset.ai/forex/cot-reports?pair=EURUSD" \
  -H "X-API-KEY: sk_your_key"
```

## Pretty print with jq

```bash theme={null}
curl -s "https://api.marketdataset.ai/crypto/open-interest?symbol=ETHUSDT&interval=1h&limit=5" \
  -H "X-API-KEY: sk_your_key" | jq '.open_interest[] | {time: .timestamp, oi: .open_interest_value}'
```

## Check your credit balance

The `meta.credits_remaining` field in every response shows your current balance:

```bash theme={null}
curl -s "https://api.marketdataset.ai/forex/pairs" \
  -H "X-API-KEY: sk_your_key" | jq '.meta'
```
