curl --request POST \
--url https://public-api.etoro.com/api/v1/posts/polls \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <api-key>' \
--data '
{
"message": "Where do you think $TSLA will be in 6 months?",
"poll": {
"title": "TSLA price target in 6 months?",
"options": [
{
"text": "Above $300",
"index": 1
}
]
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
}
}
}
]
}
'import requests
url = "https://public-api.etoro.com/api/v1/posts/polls"
payload = {
"message": "Where do you think $TSLA will be in 6 months?",
"poll": {
"title": "TSLA price target in 6 months?",
"options": [
{
"text": "Above $300",
"index": 1
}
]
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": { "image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
} }
}
]
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<api-key>",
"x-user-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message: 'Where do you think $TSLA will be in 6 months?',
poll: {
title: 'TSLA price target in 6 months?',
options: [{text: 'Above $300', index: 1}]
},
attachments: [
{
url: 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg',
title: 'Tesla Q4 Earnings Chart',
host: 'cdn.etoro.com',
description: 'Tesla quarterly earnings breakdown',
mediaType: 'Image',
media: {
image: {
width: 1200,
height: 630,
url: 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg'
}
}
}
]
})
};
fetch('https://public-api.etoro.com/api/v1/posts/polls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.etoro.com/api/v1/posts/polls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Where do you think $TSLA will be in 6 months?',
'poll' => [
'title' => 'TSLA price target in 6 months?',
'options' => [
[
'text' => 'Above $300',
'index' => 1
]
]
],
'attachments' => [
[
'url' => 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg',
'title' => 'Tesla Q4 Earnings Chart',
'host' => 'cdn.etoro.com',
'description' => 'Tesla quarterly earnings breakdown',
'mediaType' => 'Image',
'media' => [
'image' => [
'width' => 1200,
'height' => 630,
'url' => 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v1/posts/polls"
payload := strings.NewReader("{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-user-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.etoro.com/api/v1/posts/polls")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<api-key>")
.header("x-user-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v1/posts/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<api-key>'
request["x-user-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"owner": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
},
"obsoleteId": "12345",
"created": "2025-01-15T10:30:00Z",
"message": {
"text": "Excited about $TSLA earnings next week!",
"languageCode": "en"
},
"updated": "2025-01-16T08:00:00Z",
"isDeleted": false,
"type": "Default",
"metadata": {
"share": {
"sharedPost": "<unknown>",
"sharedOriginPost": "<unknown>"
},
"marketEvent": {
"earningReportId": 1042,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"stocksIndustryId": 15,
"earningsDate": "2025-01-15T10:30:00Z",
"isBeforeMarketOpen": true,
"earningsYear": 2025,
"earningsQuarter": 1,
"verified": true,
"marketCap": 800000000000,
"estimatedEps": 1.42,
"estimatedSales": 25000000000,
"tagName": "Reports",
"textKey": 3
},
"trade": {
"type": "Open",
"positionId": 987654321,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"gain": 12.5,
"rate": 245.3,
"direction": "Long"
},
"order": {
"type": "Open",
"orderId": 123456789,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"rate": 240,
"direction": "Long"
},
"copy": {
"type": "Start",
"user": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
}
},
"poll": {
"id": 55,
"title": "Where do you see $TSLA by year-end?",
"gcid": 7890,
"options": [
{
"id": 1,
"index": 1,
"text": "Bullish",
"isUserVoted": false,
"votesCount": 128
}
]
},
"article": {
"id": 9001,
"title": "Why TSLA Could Hit $500 This Year",
"url": "https://etoro.com/news/markets/articles/why-tsla-could-hit-500",
"rating": "Bullish",
"featuredImage": {
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
},
"video": {
"videoSourceId": "dQw4w9WgXcQ",
"videoSource": "YouTube",
"image": {
"width": 1280,
"height": 720,
"url": "https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
}
}
}
},
"body": "<p>Tesla has shown strong fundamentals...</p>",
"bodyPreview": "Tesla has shown strong fundamentals this quarter...",
"aiSummary": "Analyst argues Tesla's pipeline supports a $500 target by year-end.",
"languageCode": "en",
"status": "Published",
"editStatus": "None",
"ownerId": 7890,
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-16T08:00:00Z",
"published": "2025-01-16T09:00:00Z",
"readingTimeMinutes": 3.5,
"wordCount": 750
}
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
},
"video": {
"videoSourceId": "dQw4w9WgXcQ",
"videoSource": "YouTube",
"image": {
"width": 1280,
"height": 720,
"url": "https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
}
}
}
}
],
"tags": [
{
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
}
}
],
"mentions": [
{
"user": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
},
"isDirect": true
}
],
"isSpam": false,
"editStatus": "None"
}Create a poll post
Rate limit: 60 requests per 60 seconds. This is the default shared quota — it is shared with every other endpoint that has no dedicated limit, so requests across those endpoints all draw from the same budget.
Creates a new poll post. The poll must include a title and at least 2 options. Once created the poll is immutable — options and title cannot be changed. The post itself can still be deleted.
curl --request POST \
--url https://public-api.etoro.com/api/v1/posts/polls \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <api-key>' \
--data '
{
"message": "Where do you think $TSLA will be in 6 months?",
"poll": {
"title": "TSLA price target in 6 months?",
"options": [
{
"text": "Above $300",
"index": 1
}
]
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
}
}
}
]
}
'import requests
url = "https://public-api.etoro.com/api/v1/posts/polls"
payload = {
"message": "Where do you think $TSLA will be in 6 months?",
"poll": {
"title": "TSLA price target in 6 months?",
"options": [
{
"text": "Above $300",
"index": 1
}
]
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": { "image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
} }
}
]
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<api-key>",
"x-user-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message: 'Where do you think $TSLA will be in 6 months?',
poll: {
title: 'TSLA price target in 6 months?',
options: [{text: 'Above $300', index: 1}]
},
attachments: [
{
url: 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg',
title: 'Tesla Q4 Earnings Chart',
host: 'cdn.etoro.com',
description: 'Tesla quarterly earnings breakdown',
mediaType: 'Image',
media: {
image: {
width: 1200,
height: 630,
url: 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg'
}
}
}
]
})
};
fetch('https://public-api.etoro.com/api/v1/posts/polls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public-api.etoro.com/api/v1/posts/polls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => 'Where do you think $TSLA will be in 6 months?',
'poll' => [
'title' => 'TSLA price target in 6 months?',
'options' => [
[
'text' => 'Above $300',
'index' => 1
]
]
],
'attachments' => [
[
'url' => 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg',
'title' => 'Tesla Q4 Earnings Chart',
'host' => 'cdn.etoro.com',
'description' => 'Tesla quarterly earnings breakdown',
'mediaType' => 'Image',
'media' => [
'image' => [
'width' => 1200,
'height' => 630,
'url' => 'https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v1/posts/polls"
payload := strings.NewReader("{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-user-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public-api.etoro.com/api/v1/posts/polls")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<api-key>")
.header("x-user-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v1/posts/polls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<api-key>'
request["x-user-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Where do you think $TSLA will be in 6 months?\",\n \"poll\": {\n \"title\": \"TSLA price target in 6 months?\",\n \"options\": [\n {\n \"text\": \"Above $300\",\n \"index\": 1\n }\n ]\n },\n \"attachments\": [\n {\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\",\n \"title\": \"Tesla Q4 Earnings Chart\",\n \"host\": \"cdn.etoro.com\",\n \"description\": \"Tesla quarterly earnings breakdown\",\n \"mediaType\": \"Image\",\n \"media\": {\n \"image\": {\n \"width\": 1200,\n \"height\": 630,\n \"url\": \"https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"owner": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
},
"obsoleteId": "12345",
"created": "2025-01-15T10:30:00Z",
"message": {
"text": "Excited about $TSLA earnings next week!",
"languageCode": "en"
},
"updated": "2025-01-16T08:00:00Z",
"isDeleted": false,
"type": "Default",
"metadata": {
"share": {
"sharedPost": "<unknown>",
"sharedOriginPost": "<unknown>"
},
"marketEvent": {
"earningReportId": 1042,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"stocksIndustryId": 15,
"earningsDate": "2025-01-15T10:30:00Z",
"isBeforeMarketOpen": true,
"earningsYear": 2025,
"earningsQuarter": 1,
"verified": true,
"marketCap": 800000000000,
"estimatedEps": 1.42,
"estimatedSales": 25000000000,
"tagName": "Reports",
"textKey": 3
},
"trade": {
"type": "Open",
"positionId": 987654321,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"gain": 12.5,
"rate": 245.3,
"direction": "Long"
},
"order": {
"type": "Open",
"orderId": 123456789,
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
},
"rate": 240,
"direction": "Long"
},
"copy": {
"type": "Start",
"user": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
}
},
"poll": {
"id": 55,
"title": "Where do you see $TSLA by year-end?",
"gcid": 7890,
"options": [
{
"id": 1,
"index": 1,
"text": "Bullish",
"isUserVoted": false,
"votesCount": 128
}
]
},
"article": {
"id": 9001,
"title": "Why TSLA Could Hit $500 This Year",
"url": "https://etoro.com/news/markets/articles/why-tsla-could-hit-500",
"rating": "Bullish",
"featuredImage": {
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
},
"video": {
"videoSourceId": "dQw4w9WgXcQ",
"videoSource": "YouTube",
"image": {
"width": 1280,
"height": 720,
"url": "https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
}
}
}
},
"body": "<p>Tesla has shown strong fundamentals...</p>",
"bodyPreview": "Tesla has shown strong fundamentals this quarter...",
"aiSummary": "Analyst argues Tesla's pipeline supports a $500 target by year-end.",
"languageCode": "en",
"status": "Published",
"editStatus": "None",
"ownerId": 7890,
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-16T08:00:00Z",
"published": "2025-01-16T09:00:00Z",
"readingTimeMinutes": 3.5,
"wordCount": 750
}
},
"attachments": [
{
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg",
"title": "Tesla Q4 Earnings Chart",
"host": "cdn.etoro.com",
"description": "Tesla quarterly earnings breakdown",
"mediaType": "Image",
"media": {
"image": {
"width": 1200,
"height": 630,
"url": "https://cdn.etoro.com/rich-media/images/johndoe/abc-2025-01-15.jpg"
},
"video": {
"videoSourceId": "dQw4w9WgXcQ",
"videoSource": "YouTube",
"image": {
"width": 1280,
"height": 720,
"url": "https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
}
}
}
}
],
"tags": [
{
"market": {
"id": "TSLA",
"symbolName": "TSLA",
"displayName": "Tesla",
"updated": "2025-01-15T00:00:00Z",
"assetType": "Stocks",
"internalId": 59114,
"avatar": {
"small": "https://cdn.etoro.com/assets/img/markets/TSLA/small.png",
"medium": "https://cdn.etoro.com/assets/img/markets/TSLA/medium.png",
"large": "https://cdn.etoro.com/assets/img/markets/TSLA/large.png",
"svg": {
"url": "https://cdn.etoro.com/assets/img/markets/TSLA/logo.svg",
"backgroundColor": "#CC0000",
"textColor": "#FFFFFF"
}
},
"application": "eToro",
"metadata": "{}",
"assetTypeId": 10,
"assetTypeSubCategoryId": 101
}
}
],
"mentions": [
{
"user": {
"id": "7890",
"username": "johndoe",
"firstName": "John",
"lastName": "Doe",
"avatar": {
"small": "https://etoro-cdn.etorostatic.com/avatars/150X150/johndoe.jpg",
"medium": "https://etoro-cdn.etorostatic.com/avatars/200X200/johndoe.jpg",
"large": "https://etoro-cdn.etorostatic.com/avatars/300X300/johndoe.jpg",
"svg": {
"url": "https://etoro-cdn.etorostatic.com/avatars/svg/johndoe.svg",
"backgroundColor": "#2196F3",
"textColor": "#FFFFFF"
}
},
"roles": [
"Regular"
],
"isBlocked": false,
"isPrivate": false,
"countryCode": 840,
"piLevel": 0
},
"isDirect": true
}
],
"isSpam": false,
"editStatus": "None"
}Authorizations
API key of the application. Only valid together with the x-user-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it. The pair is granted the same permissions the operation's OAuth scopes describe.
Demo credential for trying the API from these docs: lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663
User-specific authentication key. Only valid together with the x-api-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it.
Demo credential for trying the API from these docs: eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_
Headers
A unique request identifier.
"b77079fc-4838-4fe6-8b40-ac0fd2570473"
Body
Poll post content
Request body for creating a poll post
Response
Poll post created
A feed post returned by create / update / get-by-ID
Unique post ID
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
eToro user profile (slim projection)
Show child attributes
Show child attributes
Legacy numeric post ID
"12345"
Creation timestamp
"2025-01-15T10:30:00Z"
Post/comment text content
Show child attributes
Show child attributes
Last-edited timestamp
"2025-01-16T08:00:00Z"
True when the post has been soft-deleted
false
Post type
Default, Share, MarketEvent, Trade, Order, Copy, Poll, Article "Default"
Post type–specific metadata — only the relevant key is populated
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
True when the post is classified as spam
false
Edit lifecycle status
None, Edited, Moderated "None"