Back to home

MetaAPI Docs

RPC Reference

Every RPC method exposed through the local API. Use this page as the main method index, then combine it with language-specific example pages.

Gateway Format

All RPC calls go to local POST /rpc. Requests require the same auth_token configured inside the EA in the Authorization header.

This is intentional. The local gateway should not answer every request on the machine. It should answer only the requests whose token matches the terminal instance that is currently online.

If you are not sure where that token comes from, read Auth Token first.

POST /rpc HTTP/1.1
Host: 127.0.0.1:6000
Authorization: Bearer <auth_token>
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": "req-1",
  "method": "get_account_info",
  "params": {}
}

Account and Terminal

  • get_account_info
  • get_account_balance
  • get_terminal_info
  • get_server_time
  • get_ea_status

Symbols and Market Data

  • get_symbols
  • get_symbol_info
  • get_ohlc
  • get_history_prices
  • get_history_ticks

Positions and Orders

  • get_positions
  • get_orders
  • get_order_info
  • place_order
  • modify_order
  • cancel_order
  • close_position

History

  • get_history_orders — the base history endpoint
  • SDK wrappers: get_history_orders(), get_history_positions(), get_history_deals(), get_history_orders_deals()

Subscriptions

  • get_subscriptions
  • subscribe
  • unsubscribe

SDK helpers on top of this include:

  • subscribe_tick / unsubscribe_tick
  • subscribe_mbook / unsubscribe_mbook
  • subscribe_ohlc / unsubscribe_ohlc
  • subscribe_order / unsubscribe_order

Language Examples

For a language-specific page, start with RPC Python Examples.