API Reference

Spreshapp Public API

Three REST endpoints. JSON responses. Real-time programmatic access to the Facebook Ads Library.

Base URL https://api.spreshapp.com
Format application/json

Authentication

All requests require a valid session JWT passed as a Bearer token. Copy your token from API Access after logging in.

Authorization string header required

Bearer authentication: Bearer <token>

Example

cURL
curl -X POST https://api.spreshapp.com/v1/ad-search \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{ "query": "running shoes" }'
GET /v1/brand/:page_id 1 credit per ad returned Try it

Returns all currently active ads for a Facebook page. Filter by format and country, sort by run length or recency, and paginate with cursors.

Path parameter

page_id string required

Facebook page ID from /v1/brand/page-search.

Query parameters

sort string default: longest_running

longest_running | newest

display_format string default: ALL

IMAGE | VIDEO | ALL

country string default: ALL

Comma-separated ISO codes. Default: ALL

cursor string optional

Pagination cursor from a previous response

cURL
curl "https://api.spreshapp.com/v1/brand/15087023444?sort=newest&country=US" \
  -H "Authorization: Bearer <token>"
200
{
  "ads": [
    {
      "ad_archive_id": "9876543210",
      "page_name": "Nike",
      "body_text": "Just Do It.",
      "display_format": "IMAGE",
      "ad_started_on": 1709251200,
      "cta": "Shop Now",
      "landing_page": "https://nike.com/...",
      "image_url": "https://cdn.example.com/..."
    }
  ],
  "next_cursor": "AQHXtz9c...",
  "has_more": true
}

Error codes

StatusErrorMeaning
401UnauthorizedMissing or invalid JWT token
403feature_not_availableAccount does not have API access
429credits_exhaustedMonthly credits used up. Check reset_at in response.
400Bad requestMissing or invalid request parameters
503Service unavailableUpstream error, retry with exponential backoff

Credits

Every account gets 100 free credits per month, including free accounts. Additional credits are available as a paid add-on (5,000 credits for $3/month). Credits reset on the 1st of each month and do not roll over.

EndpointCost
POST /v1/ad-search1 credit per ad returned
GET /v1/brand/page-search5 credits per call
GET /v1/brand/:page_id1 credit per ad returned

Get started

Start building in minutes

Free accounts include 100 credits per month. No credit card required to get started.