# Myfxbook — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Track global economic events, interest rates, and market schedules by searching the comprehensive economic calendar across countries and dates. Access detailed event histories, historical releases, and market holidays to stay informed on financial market movements and economic indicators.

**Category:** Finance & Markets | **Website:** [myfxbook.com/](https://myfxbook.com/) | **Docs:** [parse.bot/marketplace/8890241a-677d-4e85-9667-b12b2fe0d8df/myfxbook-com-api](https://parse.bot/marketplace/8890241a-677d-4e85-9667-b12b2fe0d8df/myfxbook-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_economic_calendar

Fetch economic calendar events for a named time window. Returns all scheduled and released events within the chosen period including country, currency, impact level, and consensus/actual values. Periods cover rolling calendar windows relative to today.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `period` | string | No | Time period for calendar events. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_economic_calendar \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":"<string>"}'
```

### get_economic_calendar_by_country

Fetch economic calendar events filtered by country. Returns all upcoming events for the specified country along with a country description when available.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | Yes | Country slug identifier (e.g. united-states, united-kingdom, japan, australia, germany, canada). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_economic_calendar_by_country \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>"}'
```

### get_economic_calendar_by_date

Fetch economic calendar events for a specific date. Returns the same event structure as get_economic_calendar but scoped to a single calendar day.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Date in YYYY-MM-DD format. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_economic_calendar_by_date \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>"}'
```

### get_event_detail

Fetch detailed information for a specific economic event including its name, impact level, description, and internal event_id (needed for historical data retrieval).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | Yes | Country slug (e.g. united-states, united-kingdom). |
| `event_slug` | string | Yes | Event slug (e.g. initial-jobless-claims, gdp-growth-rate-qoq). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_event_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>","event_slug":"<string>"}'
```

### get_event_history

Fetch historical release data for a specific economic event. Provide either event_id directly, or both event_slug and country_slug to look up the event_id automatically. Returns paginated historical records with date, time, previous, consensus, and actual values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | No | Country slug (used with event_slug, e.g. united-states). |
| `event_id` | string | No | Event ID from get_event_detail response (can be negative, e.g. -406261830). |
| `event_slug` | string | No | Event slug (used with country_slug to look up event_id, e.g. initial-jobless-claims). |
| `page` | integer | No | Page number for paginated results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_event_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>","event_id":"<string>","event_slug":"<string>","page":"<integer>"}'
```

### get_holidays_calendar

Fetch market and bank holidays for the current week. Returns exchange closure information with date, country, currency, and holiday name.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_holidays_calendar \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_interest_rates

Fetch central bank interest rates for all tracked countries. Returns the current rate, previous rate, basis-point change, and meeting dates for each central bank.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_interest_rates \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_market_hours

Fetch forex market session hours for major financial centers (Tokyo, Sydney, New York, London) over a rolling multi-day window. Returns a flat list of sessions with day label, market name, and UTC open/close times, plus a liquidity average.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/get_market_hours \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_economic_events

Search economic calendar events by keyword across event names, countries, and currencies. Searches next week's scheduled events and filters results by the query string (case-insensitive substring match).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword to match against event name, country, or currency (e.g. GDP, inflation, employment, jobless). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-myfxbook-com-api-8890241a/search_economic_events \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
