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 search for instruments by name 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/search?query=Apple`,
{
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.results.length} matching instruments`);
curl -X GET "https://public-api.etoro.com/api/v1/market-data/search?query=Apple" \
-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/search",
params={"query": "Apple"},
headers=headers,
)
data = response.json()
print(f"Found {len(data['results'])} matching 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.
What Changed in v2
- Uses the
/market-data/search endpoint for instrument discovery instead of fetching the full instrument list
- Adds query parameter patterns for filtering server-side
- Same authentication headers (
x-api-key, x-user-key, x-request-id)
Next Steps
Now that you've made your first request, explore these guides: