Skip to main content
GET
/
api
/
v2
/
portfolios
/
{username}
/
gain
/
{granularity}
Get investor gain time-series
curl --request GET \
  --url https://public-api.etoro.com/api/v2/portfolios/{username}/gain/{granularity} \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-request-id: <x-request-id>' \
  --header 'x-user-key: <x-user-key>'
{
  "username": "<string>",
  "gains": [
    {
      "date": "2023-12-25",
      "gain": 123
    }
  ],
  "totalGain": 123
}

Headers

x-request-id
string<uuid>
required

A unique request identifier.

Example:

"cbc3fc06-56f5-4ece-8fad-0fe276be7499"

x-api-key
string<password>
required

API key for authentication.

Example:

"lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663"

x-user-key
string<password>
required

User-specific authentication key.

Example:

"eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_"

Path Parameters

username
string
required
granularity
enum<string>
required
Available options:
daily,
monthly,
yearly

Query Parameters

minDate
string<date>
maxDate
string<date>
count
integer
Required range: 1 <= x <= 1000

Response

Successful response

username
string
required
granularity
enum<string>
required
Available options:
daily,
monthly,
yearly
gains
object[]
required
totalGain
number | null

Compound gain over the returned series as a decimal fraction. Null when gains is empty.