X post analytics
curl --request GET \
--url https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts', 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://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "550e8400-e29b-41d4-a716-446655440700",
"url": "https://x.com/acme/status/1234567890123456789",
"text": "Excited to share our latest product update! π\n\nAfter months of development, we're launching three new features that will transform how you work.\n\nThread π§΅π",
"publishedAt": "2024-12-10T14:00:00.000Z",
"likeCount": 342,
"replyCount": 28,
"retweetCount": 89,
"quoteCount": 15,
"bookmarkCount": 67,
"impressionCount": 45200,
"engagement": 0.01,
"emv": 452,
"ordinalPost": {
"id": "11111111-1111-4111-a111-111111111111",
"title": "My Ordinal Post",
"labels": [
{
"name": "Marketing",
"labelId": "22222222-2222-4222-a222-222222222222"
}
],
"campaign": {
"id": "33333333-3333-4333-a333-333333333333",
"name": "Q1 Campaign"
}
}
},
{
"id": "550e8400-e29b-41d4-a716-446655440701",
"url": "https://x.com/acme/status/1234567890123456790",
"text": "5 lessons learned from scaling our startup from 0 to 10k users π\n\nA thread:",
"publishedAt": "2024-12-05T09:30:00.000Z",
"likeCount": 1256,
"replyCount": 94,
"retweetCount": 312,
"quoteCount": 48,
"bookmarkCount": 234,
"impressionCount": 89300,
"engagement": 0.019,
"emv": 893,
"ordinalPost": null
}
]{
"code": "UNAUTHORIZED",
"message": "Invalid or unauthorized API key"
}{
"code": "FORBIDDEN",
"message": "Engagement profiles cannot be used for analytics"
}{
"code": "NOT_FOUND",
"message": "Post not found or does not belong to this workspace"
}Analytics
X post analytics
Retrieve post analytics for an X profile within a date range. When a post was published from Ordinal, the response includes an ordinalPost object with the linked postβs id, title, labels, and campaign.
GET
/
analytics
/
x
/
{profileId}
/
posts
X post analytics
curl --request GET \
--url https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts', 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://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryordinal.com/api/v1/analytics/x/{profileId}/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "550e8400-e29b-41d4-a716-446655440700",
"url": "https://x.com/acme/status/1234567890123456789",
"text": "Excited to share our latest product update! π\n\nAfter months of development, we're launching three new features that will transform how you work.\n\nThread π§΅π",
"publishedAt": "2024-12-10T14:00:00.000Z",
"likeCount": 342,
"replyCount": 28,
"retweetCount": 89,
"quoteCount": 15,
"bookmarkCount": 67,
"impressionCount": 45200,
"engagement": 0.01,
"emv": 452,
"ordinalPost": {
"id": "11111111-1111-4111-a111-111111111111",
"title": "My Ordinal Post",
"labels": [
{
"name": "Marketing",
"labelId": "22222222-2222-4222-a222-222222222222"
}
],
"campaign": {
"id": "33333333-3333-4333-a333-333333333333",
"name": "Q1 Campaign"
}
}
},
{
"id": "550e8400-e29b-41d4-a716-446655440701",
"url": "https://x.com/acme/status/1234567890123456790",
"text": "5 lessons learned from scaling our startup from 0 to 10k users π\n\nA thread:",
"publishedAt": "2024-12-05T09:30:00.000Z",
"likeCount": 1256,
"replyCount": 94,
"retweetCount": 312,
"quoteCount": 48,
"bookmarkCount": 234,
"impressionCount": 89300,
"engagement": 0.019,
"emv": 893,
"ordinalPost": null
}
]{
"code": "UNAUTHORIZED",
"message": "Invalid or unauthorized API key"
}{
"code": "FORBIDDEN",
"message": "Engagement profiles cannot be used for analytics"
}{
"code": "NOT_FOUND",
"message": "Post not found or does not belong to this workspace"
}Authorizations
API key authentication. Generate an API key from your workspace settings.
Path Parameters
X profile ID (UUID)
Query Parameters
Start date for analytics (defaults to 30 days ago)
End date for analytics (defaults to today)
Response
X post analytics
Twitter post URL
Tweet text content
Engagement rate (total engagements / impressions), typically between 0 and 1
Earned Media Value calculated as (impressionCount / 1000) * CPM
Linked Ordinal post when this external post was published from Ordinal, null otherwise
Show child attributes
Show child attributes
Was this page helpful?