https://api.nexscope.ai/social/facebook/adLibrary/adRun this API
Send a JSON request to execute this API and receive the documented response payload.
Endpoint
| Method | POST |
| Path | https://api.nexscope.ai/social/facebook/adLibrary/ad |
| Auth | Bearer API key |
| Content-Type | application/json |
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | optional | Facebook Ad Id |
url | string | optional | Facebook Ad URL Example: https://www.facebook.com/ads/library?id=1977941946171006 |
allow_long_transcription | boolean | optional | Paid opt-in, enabled only by the literal query value 'true' (allow_long_transcription=true). Defaults to false when omitted; other values do not enable paid mode. By default, successful AI transcription of videos up to 120 seconds (two minutes, inclusive) costs a flat 1 credit per request. Over 120 seconds, videos cannot be AI-transcribed by default. Set allow_long_transcription=true to opt into paid AI with no fixed duration cap: ALL successful AI transcriptions in this mode cost 10 credits per started minute, including short videos: 10 * ceil(duration_seconds / 60). For example, 177 seconds costs 30 credits and an opted-in 60 seconds costs 10 credits. Empty AI results and errors cost 0 credits for AI transcription. This flag does not force AI and does not enable transcription or AI fallback by itself. Keep get_transcript=true or use_ai_as_fallback=true where required by the endpoint. Returned native captions still cost 1 credit on dedicated transcript routes, even for long videos with this flag; on detail routes they leave the base price unchanged. These routes remain synchronous. Allow at least 30 seconds on your client. Paid long transcription can exceed resource limits or timeouts, so successful transcription of long videos is not guaranteed. |
get_transcript | boolean | optional | Transcription is opt-in via get_transcript=true. Default short AI (up to 120 seconds, inclusive) is included in the existing base endpoint price, with no extra AI fee. By default, successful AI transcription of videos up to 120 seconds (two minutes, inclusive) costs a flat 1 credit per request. Over 120 seconds, videos cannot be AI-transcribed by default. Set allow_long_transcription=true to opt into paid AI with no fixed duration cap: ALL successful AI transcriptions in this mode cost 10 credits per started minute, including short videos: 10 * ceil(duration_seconds / 60). For example, 177 seconds costs 30 credits and an opted-in 60 seconds costs 10 credits. Empty AI results and errors cost 0 credits for AI transcription. On detail routes, successful paid-mode AI costs are in addition to the existing base endpoint cost; media-download pricing is unchanged. Returned native captions leave the base endpoint price unchanged. Empty AI results and errors incur no AI fee; the base scrape fee still applies when the detail scrape succeeds. These routes remain synchronous. Allow at least 30 seconds on your client. Paid long transcription can exceed resource limits or timeouts, so successful transcription of long videos is not guaranteed. |
trim | boolean | optional | Set to true for a trimmed down version of the response |
cache_max_age | string | optional | If we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with "cached": true and a "cached_at" timestamp). Otherwise, scrape a live result (1 credit; default short AI is included; allow_long_transcription=true adds 10 credits per started minute to the existing base cost). [See the Caching page for details.](https://docs.scrapecreators.com/caching) |
Social data contract
Use your Nexscope API key. No supplier credentials are required. Requests reject unknown fields, including pageSize. URLs require HTTPS and an exact supported platform host and resource path. Documented YouTube video URLs may use youtu.be; other short links are unsupported. Check the request schema for supported fields and defaults.
Each request fetches one page. Continue manually with the returned nextCursor, or nextPage for Instagram Reels (pages 1–11). Cursors are opaque, unchanged strings up to 65536 UTF-8 bytes. No automatic pagination, retry, media download or transcription is performed. Repeated requests may purchase data again.
Resource status is independent of HTTP and billing: AVAILABLE, PARTIAL, PRIVATE, RESTRICTED, NOT_FOUND, NO_TRANSCRIPT or UNKNOWN can accompany code 0. Unknown values remain null; arrays remain empty arrays. fetchedAt is the response observation time; sourceFetchedAt is null without source evidence.
usage.billingStatus is NOT_CHARGED, SETTLED or UNKNOWN; chargedCredits is null when unconfirmed. Unknown charges never mean free. Completed lookups have a minimum charge of 10 credits, including cached, no-caption and unavailable-resource results; check API usage records for the actual charge. Parameter errors and unpublished APIs use the standard error envelope; upstream failures use code 13007, rate limits 429 and timeouts 408. Always check code and msg.
Response example
Platform response envelope. code 0 indicates success or acceptance; data contains the business result.
{
"code": 0,
"cost": "-1",
"data": {
"data": {
"aaa_info": null,
"adArchiveID": "1185617869915074",
"endDate": 1750316400,
"endDateString": "2025-06-19T07:00:00.000Z",
"isAAAEligible": false,
"isActive": true,
"pageID": "15087023444",
"pageName": "Nike",
"politicalCountries": [],
"publisherPlatform": [
"facebook"
],
"reachEstimate": null,
"snapshot": {
"ad_creative_id": "1809449763118705",
"body_translations": {},
"byline": null,
"caption": "fb.com",
"cards": [],
"creation_time": 1750344986,
"cta_text": "Learn more",
"display_format": "image",
"dynamic_item_flags": {},
"dynamic_versions": null,
"edited_snapshots": [],
"event": [],
"extra_images": [
{
"original_image_handle": "https://scontent-ord5-1.xx.fbcdn.net/v/t39.35426-6/508997149_744746594672572_3057533797808431470_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=eKgqs7-b06UQ7kNvwGSYm41&_nc_oc=AdnV_v1Anh3aqBBXDa3xwDrMtLJUCvE8yKIgP5ODbX3xsSMCtTv2ucMTy36I8Bq20HU&_nc_zt=14&_nc_ht=scontent-ord5-1.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfNfDJHp6d0Ie9tIXLBIXFQiMgWHVl1i48DahYYOgANgHg&oe=685A4B4A",
"resized_image_handle": "https://scontent-ord5-1.xx.fbcdn.net/v/t39.35426-6/508997149_744746594672572_3057533797808431470_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=108&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=eKgqs7-b06UQ7kNvwGSYm41&_nc_oc=AdnV_v1Anh3aqBBXDa3xwDrMtLJUCvE8yKIgP5ODbX3xsSMCtTv2ucMTy36I8Bq20HU&_nc_zt=14&_nc_ht=scontent-ord5-1.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfMe107fPkaznD6Pw8_wDaon3p-31ZXLHIeglHU_P3NYNw&oe=685A4B4A"
}
],
"extra_links": [
"https://www.nike.com.ar/"
],
"extra_texts": [],
"extra_videos": [],
"images": [
{
"image_crops": {},
"original_image_url": "https://scontent-ord5-2.xx.fbcdn.net/v/t39.35426-6/499542231_3815578848587795_5060085138610262269_n.jpg?_nc_cat=104&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=yk26_frcPLkQ7kNvwF5EWnq&_nc_oc=Adk8Xjt1SjUg-mBxkm6iUuDfXpyGXD5G5g6PBae8g0WWsJT-MfnhNGII7JL-KM5MJBE&_nc_zt=14&_nc_ht=scontent-ord5-2.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfP6zfVuLkcD2Zts0gItXp801QK1k0lhEfqwwdqfNAU9gw&oe=685A3E80",
"resized_image_url": "https://scontent-ord5-3.xx.fbcdn.net/v/t39.35426-6/509090139_3448752085259208_8196922920009954562_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=107&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=tV3v2Y_NIh0Q7kNvwEMM-Vk&_nc_oc=AdnpccGMqNlM0k9O87VmMBIp9pGtj3l1dkO5HaKRCti2V4X6AKUn8BR08SXOc_Y-8TY&_nc_zt=14&_nc_ht=scontent-ord5-3.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfPXGzKezcPJSpAq8Ql2Xgx6Rn0a3Poit-iTirfhAwuiHA&oe=685A5634",
"watermarked_resized_image_url": ""
}
],
"instagram_actor_name": "Nike",
"instagram_handle": "",
"instagram_profile_pic_url": "https://scontent-ord5-3.xx.fbcdn.net/v/t39.35426-6/499229861_3519049748228633_8442052921006945421_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=eJcuzztd8e4Q7kNvwEpFLbr&_nc_oc=AdlI7WAi5QRhAOZCLwHcU3ZgxpxWSTzJr9PjPiwtUN9U2mkMB49Surq8HsQcDWfnTVc&_nc_zt=14&_nc_ht=scontent-ord5-3.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfNnIjlMGopiAeVY7yEOxCT0sEvrij87SMrpkGJHs1lT-w&oe=685A55E2",
"instagram_shopping_products": [],
"instagram_url": "",
"is_reshared": false,
"link_description": null,
"link_url": "https://fb.com/canvas_doc/1952657995267951",
"page_categories": {
"1713352298924731": "Sportswear"
},
"page_entity_type": "person_profile",
"page_id": "15087023444",
"page_is_profile_page": false,
"page_name": "Nike",
"page_profile_picture_url": "https://scontent-ord5-2.xx.fbcdn.net/v/t39.35426-6/508670148_9776464209142246_4487234065380829819_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=Q0UJas7Kz2wQ7kNvwGKBRCa&_nc_oc=AdnobFr6ScYQJzp_Za4UEgMY34n373z6WuZwOA3h-ixlpbii4wA8lxcgAsbtBpCE3t4&_nc_zt=14&_nc_ht=scontent-ord5-2.xx&_nc_gid=ocFZ2kPWmNZ0nKyk5HCtkQ&oh=00_AfMlwCCMXN-4KPAZac9pYLWrHGZpld9SoTX1r9S9xRHB8Q&oe=685A5861",
"page_welcome_message": null,
"title": "6 cuotas sin interés",
"version": 3,
"videos": []
},
"spend": null,
"startDate": 1750316400,
"startDateString": "2025-06-19T07:00:00.000Z",
"success": true,
"totalActiveTime": 23488,
"url": "https://www.facebook.com/ads/library?id=1185617869915074"
},
"platform": "facebook-ad-library",
"resourceStatus": "AVAILABLE",
"usage": {
"billingStatus": "UNKNOWN"
}
},
"msg": null,
"time": "2026-01-01 00:00:00",
"traceId": null,
"ts": "0"
}Response fields
| Name | Type | Required | Description |
|---|---|---|---|
code | integer | required | 0 means accepted or successful; nonzero is a platform error. |
cost | string | required | Elapsed milliseconds, never credits; -1 outside web requests. |
data | any | required | Data value used by this API operation. |
msg | string | null | required | Msg value used by this API operation. |
time | string | required | Server local time: yyyy-MM-dd HH:mm:ss. |
traceId | string | null | required | Trace id value used by this API operation. |
ts | string | required | Epoch milliseconds. |
Any of option 1 — requires platform, resourceStatus, data, usage
| Name | Type | Required | Description |
|---|---|---|---|
data | object | required | Data value used by this API operation. |
data.data | object | required | Data value used by this API operation. |
data.platform | string | required | Platform value used by this API operation. |
data.resourceStatus | string | required | Resource status value used by this API operation. |
data.usage | object | required | Usage value used by this API operation. |
Any of option 2
| Name | Type | Required | Description |
|---|---|---|---|
data | null | required | Data value used by this API operation. |
Responses
| Code | Description |
|---|---|
| 200 | Default HTTP response for both success and many business errors. Only outer JSON code 0 indicates success or asynchronous acceptance; inspect data for the result. |
| 429 | Execution admission rate limit; honor Retry-After when present. |
| 503 | Execution admission is temporarily unavailable; honor Retry-After when present. |
| Opt-in | X-Nexscope-Http-Status: semantic maps controller-handled business errors to HTTP status on run and task routes. Pre-authentication failures, such as a missing API key (code 11209), may still return HTTP 200 before this mapping. Always check the outer JSON code; malformed requests and infrastructure failures may also return non-200 HTTP responses. |
Data source, freshness, and limitations
Source, freshness, coverage, rate limits, and estimation notes are not specified in this API definition unless they appear in the request or response field documentation above. Do not assume official marketplace data or real-time freshness when it is not explicitly documented.