Skip to content
Connect an agent

Posts

Read a post's counts

Views, likes, comments, reposts and quotes for each account the post was published to, read from the platforms now.

GET/v1/posts/{id}/metrics

TL;DR

QuestionAnswer
What does it do?Read a post's counts.
What does it need?An API key or an OAuth access token.
What does it take?id in the path.
What does it return?Status 200 with a body of type PostMetrics.
In the SDK?flung.posts.metrics()
As an MCP tool?get_post_metrics
What can go wrong?401 Missing, unknown, revoked or expired API key; 404 No such post in this workspace; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

What it does

Views, likes, comments, reposts and quotes for each account the post was published to, read from the platforms now. A platform leaves out what it does not report; LinkedIn, TikTok, Pinterest and Discord report nothing to Flung.

Example

bash
curl -X GET 'https://api.flung.dev/v1/posts/post_aaaaaaaaaaaaaaaaaaaaaaaa/metrics' \  --header "Authorization: Bearer $FLUNG_API_KEY"

A successful answer looks like this:

json
{  "data": [    {      "targetId": "string",      "accountId": "string",      "platform": "x",      "metrics": {},      "error": "string"    }  ],  "totals": {    "views": 1,    "likes": 1,    "comments": 1,    "reposts": 1,    "quotes": 1  }}

Path parameters

FieldTypeRequiredDescription
idstringyes

Responses

StatusMeaningBody
200The counts.PostMetrics
401Missing, unknown, revoked or expired API key.Error
404No such post in this workspace.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type PostMetrics.

FieldTypeRequiredDescription
dataobject[]yes
data[].targetIdstringyes
data[].accountIdstringyes
data[].platformPlatformyes
data[].metricsobject | nullyesnull when the platform has no counts for Flung, or could not be read now (see error).
data[].metrics.viewsinteger | nullyes
data[].metrics.likesinteger | nullyes
data[].metrics.commentsinteger | nullyes
data[].metrics.repostsinteger | nullyes
data[].metrics.quotesinteger | nullyes
data[].errorstring | nullyes
totalsobjectyes
totals.viewsinteger | nullyes
totals.likesinteger | nullyes
totals.commentsinteger | nullyes
totals.repostsinteger | nullyes
totals.quotesinteger | nullyes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it
get_post_metricsThe same operation as an MCP tool