Saved queries

Compare saved queries' share of voice

Share of voice: 2 to 10 saved queries' posts over the same UTC days, each as a share of their sum, overall and per day. Free; nothing is searched.

GET/v1/saved-queries/stats/compare
0credits
x-api-keystringheader

API key (`sfk_...`)

Parameters
3
idsarrayrequiredquery

2 to 10 saved query ids of this workspace, comma-separated (`sq_a,sq_b`) or repeated. A repeated id counts once.

daysintegeroptionalquery

UTC days to count, today (the day of `now`) included, from 1 to 90. Default 30.

≥ 1 · ≤ 90

nowstringoptionalquery

The window's last day is this time's UTC day, ISO 8601. Default: now. Send the same value to read the same window again.

Response fields
23

Endpoint-specific response payload.

The window: whole UTC days, oldest first.

datawindowdays
integer

UTC days in the window.

datawindowfrom
string

The first day's midnight, UTC, ISO 8601 (included).

datawindowto
string

The midnight after the last day, UTC, ISO 8601 (not included).

dataposts
integer

All the compared queries' posts in the window: the sum of theirs, so a post two queries matched counts twice.

Each query, in the order the ids were sent.

dataqueries[]savedQueryId
string
dataqueries[]name
string
dataqueries[]posts
integer

Its posts in the window, by when they were posted. Posts the platform gave no time for aren't counted.

dataqueries[]stories
integer

Of those, the stories: a post and its reposts and near-copies (`duplicateOf`) count once.

dataqueries[]share
number

This query's posts over all the compared queries' posts, from 0 to 1; 0 when none has any. While any has posts, the shares add up to 1, to within rounding. `posts` here is the sum of the query's `daily` posts from GET /v1/saved-queries/{id}/stats over the same window.

≥ 0 · ≤ 1

Every day in the window, oldest first, with zeros for a day without posts.

datadaily[]day
string

`YYYY-MM-DD`, UTC.

datadaily[]posts
integer

All the compared queries' posts that day.

Each query's posts that day, in the order sent.

datadaily[]queries[]savedQueryId
string
datadaily[]queries[]posts
integer
datadaily[]queries[]share
number

This query's posts over all the compared queries' posts, from 0 to 1; 0 when none has any. While any has posts, the shares add up to 1, to within rounding. `posts` here is the sum of the query's `daily` posts from GET /v1/saved-queries/{id}/stats over the same window.

≥ 0 · ≤ 1

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/saved-queries/stats/compare?ids=abc123,def456" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Each saved query's posts and share over the window.