Prerequisites
Before you begin, you'll need:
- An eToro account (sign up at etoro.com)
- API credentials from the eToro API Portal
- A basic understanding of REST APIs
- Node.js 18+ or Python 3.8+ installed
Getting Your API Keys
- Visit api-portal.etoro.com and sign in with your eToro account
- Navigate to Applications and create a new application
- Copy your API key (
x-api-key) and User key (x-user-key)
- Store them securely — never commit API keys to version control
Your First API Request
Let's fetch a list of available instruments using the eToro API.
import { randomUUID } from "node:crypto";
const API_BASE = "https://public-api.etoro.com/api/v1";
const response = await fetch(`${API_BASE}/market-data/instruments`, {
headers: {
"x-api-key": process.env.ETORO_API_KEY,
"x-user-key": process.env.ETORO_USER_KEY,
"x-request-id": randomUUID(),
"Accept": "application/json",
},
});
const data = await response.json();
console.log(`Found ${data.instruments.length} instruments`);
curl -X GET "https://public-api.etoro.com/api/v1/market-data/instruments" \
-H "x-api-key: $ETORO_API_KEY" \
-H "x-user-key: $ETORO_USER_KEY" \
-H "x-request-id: $(uuidgen)" \
-H "Accept: application/json"
import os
import uuid
import requests
API_BASE = "https://public-api.etoro.com/api/v1"
headers = {
"x-api-key": os.environ["ETORO_API_KEY"],
"x-user-key": os.environ["ETORO_USER_KEY"],
"x-request-id": str(uuid.uuid4()),
"Accept": "application/json",
}
response = requests.get(f"{API_BASE}/market-data/instruments", headers=headers)
data = response.json()
print(f"Found {len(data['instruments'])} instruments")
Understanding the Response
eToro API responses contain your requested data. Include an x-request-id header on every call so support can trace issues back to specific requests.
Common HTTP status codes:
- 200 — Success
- 400 — Bad request (check your parameters)
- 401 — Unauthorized (check your API key and user key)
- 429 — Rate limited (respect
Retry-After header and slow down)
- 500 — Server error (retry with exponential backoff)
Rate Limits
The eToro API enforces rate limits. Exceeding your limit returns 429 Too Many Requests with a Retry-After header. Always respect that header before retrying.
For current rate limit details, see the Rate Limits documentation.
Next Steps
Now that you've made your first request, explore these guides: