Skip to Content
APIEndpointsStart a social scan

Start a social scan

Find new discussions relevant to this brand, the same scan the “Run a scan” button in the product starts. Every scan surfaces 10 results across the channels you name: 5 on Reddit and 5 on LinkedIn when you pick both, shifting toward one channel only when the other finds fewer worth surfacing. A scan costs 20 credits, refunded per missing result if it comes up short. The brand’s first scan is free.

Only one scan may run per brand per channel at a time. A second call while one is already running is refused, not queued.

POST /brands/{brand_id}/social/scans

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired on every write. See Idempotency

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body parameters

ParameterTypeRequiredDescription
channelsstring[]optionalAny of reddit, linkedin. Defaults to ["reddit"]. LinkedIn needs a plan that includes it.
channelstringoptionalDeprecated: one channel, the same as channels with one entry.
result_countintegeroptionalDeprecated and ignored: every scan surfaces 10 results.

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/social/scans' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 3f9a1c2e-8b4d-4a6f-9c1e-2d5b7a8f9e01' \ --header 'Content-Type: application/json' \ --data '{"channels": ["reddit", "linkedin"]}'

Response

{ "data": { "scan_id": "7c9e1f3a-4b2d-4e6f-8a1c-9d3e5b7f2a10", "jobs": [ { "job_id": "7c9e1f3a-4b2d-4e6f-8a1c-9d3e5b7f2a10", "channel": "reddit", "starting_share": 5 }, { "job_id": "2f8b6d1c-9a3e-4c7b-b5d2-6e1f4a9c3b08", "channel": "linkedin", "starting_share": 5 } ], "result_count": 10, "credit_cost": 20, "is_free_scan": false, "job_id": "7c9e1f3a-4b2d-4e6f-8a1c-9d3e5b7f2a10", "channel": "reddit" }, "request_id": "req_5a3c8d0e2f4b46a1bc9d" }

Response fields

FieldTypeDescription
data.scan_iduuidrequired. The scan; also the first job’s id
data.jobsobject[]required. One per channel scanned: job_id, channel and starting_share (5 of 10 with two channels, 10 with one). Pass a job_id to Get scan status
data.result_countintegerrequired. Always 10, the results the whole scan surfaces
data.credit_costintegerrequired. 20, or 0 when is_free_scan is true
data.is_free_scanbooleanrequired
data.job_iduuidrequired. The first job, for callers written against the one-channel shape
data.channelstringrequired. The first job’s channel
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
400invalid_requestThe brand has no topics, or channels names no supported channel
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
403plan_requiredLinkedIn discovery is not included in this workspace’s plan
403quota_exceededInsufficient credits for this scan’s cost
404not_foundThe brand does not exist, or this key is not allowed to reach it
409conflictA scan is already running for this brand on one of the channels named
429rate_limitedOver 300 requests per minute. See the Retry-After header

Notes

Only one scan per brand per channel at a time, enforced at the database level. A scan naming both channels starts on both or on neither.

Always 10 results per scan. With two channels each starts at 5. If one finds fewer results worth surfacing, the other covers the gap (6/4 up to 10/0). If the whole scan still lands below 10, the missing results are refunded. Read the split from Get scan status once a job completes.

Credits and free-scan eligibility are always computed server-side. The first scan per brand is free, across channels. Read credit_cost from the response rather than predicting it.

This endpoint only starts the scan. Poll Get scan status with the returned job_id, then read the results from List social discussions once it completes.

Last updated on