Skip to content
Connect an agent

Analytics

Workspace statistics

Posts due in a window by status, publishes per platform by status, and the accounts and stored media now.

GET/v1/stats

TL;DR

QuestionAnswer
What does it do?Workspace statistics.
What does it need?An API key or an OAuth access token.
What does it take?from, to in the query string.
What does it return?Status 200 with a body of type Stats.
In the SDK?flung.analytics.stats()
What can go wrong?401 Missing, unknown, revoked or expired API key; 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

Posts due in a window by status, publishes per platform by status, and the accounts and stored media now. The window defaults to the last 30 days.

Example

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

A successful answer looks like this:

json
{  "from": "string",  "to": "string",  "posts": {    "published": 40,    "failed": 2,    "scheduled": 5  },  "platforms": [    {      "platform": "x",      "targets": {}    }  ],  "accounts": [    {      "platform": "x",      "accounts": {}    }  ],  "media": {    "files": 1,    "bytes": 1  }}

Query parameters

FieldTypeRequiredDescription
fromstringno
tostringno

Responses

StatusMeaningBody
200The statistics.Stats
401Missing, unknown, revoked or expired API key.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 Stats.

FieldTypeRequiredDescription
fromstringyes
tostringyes
postsobjectyesPosts due in the window, by status.
platformsobject[]yes
platforms[].platformPlatformyes
platforms[].targetsobjectyesPublishes to accounts on this platform, by status.
accountsobject[]yes
accounts[].platformPlatformyes
accounts[].accountsobjectyesAccounts now, by status.
mediaobjectyes
media.filesintegeryes
media.bytesintegeryes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it