AdSwipeFile public API
A small, read-only JSON API over the AdSwipeFile ad library, for signed-in accounts (free). Per list it returns the newest 20 ads; per ad, its card (name, description, brand, niche, formats, standard tags, image, page URL). For the full library and each ad's copy, use the MCP server: the same token works there.
Authentication
Every /api/v1 request needs one of:
- A signed-in session (first-party, browser): sign up free and call the API from a page on https://adswipefile.com; the session cookie is sent automatically.
- An OAuth 2.1 access token:
Authorization: Bearer <token>. It is the token the MCP flow issues, so a client already connected over MCP can reuse it.
Getting a token, for a client of your own:
- Discover: a request without credentials answers
401withWWW-Authenticate: Bearer resource_metadata="…". That document names the authorization server; its metadata is at https://adswipefile.com/.well-known/oauth-authorization-server. - Register a client:
POST https://adswipefile.com/api/auth/oauth2/register(dynamic client registration, open). - Authorize with code + PKCE (S256): https://adswipefile.com/api/auth/oauth2/authorize,
scope=mcp:read(addoffline_accessfor a refresh token),resource=https://adswipefile.com/api/mcp. The person signs in (email link or code, or Google) and approves read access. - Exchange the code at https://adswipefile.com/api/auth/oauth2/token.
Tokens are bound to the audience https://adswipefile.com/api/mcp and the scope mcp:read, for this API and the MCP server alike. A missing, invalid or expired token is a 401 problem; a token without mcp:read is a 403.
The machine-readable description is https://adswipefile.com/openapi.json (OpenAPI 3.1; every operation has an operationId, so it imports as function-calling tools).
Endpoints
GET /api/v1/search?q={keywords}: ads, brands, niches and formats matching the keywords (2 to 64 characters), each with its page URL. An ad hit'sdescriptionis its copy.GET /api/v1/ads?brand=&niche=&format=&visual_format=&hook=&season=&offer_type=&status=&type=&limit=: the newest ads, optionally filtered by slugs (brand,niche,format,visual_format,hook), byseasonandoffer_type, bystatus(runningorendedon Meta, tracked ads only) and bytype(static,videoorcarousel);limit1 to 20.hookis the hook tactic. Ads the library has not tagged yet never match a tag filter.GET /api/v1/ads/{id}: one ad's card, withwhyItWorks: the mechanism of its hook, format and offer, from its tags (never its results), and itsbreakdownonce read: what it says and its traits on every plan; its units, structure andremixscript on Starter and Growth (on Free,unitsOmittedand anotein their place). Withbrand,GET /api/v1/adsaddsbrandPatterns: read counts per type on every plan, the trait shares, top structure, format and hook on Starter and Growth. For an ad tracked on Meta it also hasmeta:platforms,cta,displayFormat,variants, andbrandMedianRunDayswithbrandTrackedAdswhen the brand has at least 5 tracked ads.GET /api/v1/visual-formatsandGET /api/v1/hooks: the standard visual formats and hook tactics in use, with their slugs and a one-line description.
Every card carries the ad's standard tags: visualFormats (up to three), hookTactic, hookLine (the hook as written), assetType, offerType, season and talent. They are empty or null until the library has tagged the ad. They describe the creative, not how it performed.
GET /api/health:{ ok, buildId, startedAt }.
Slugs are the last part of a page URL: https://adswipefile.com/niches/beauty is the niche beauty. Find them with search.
curl -s -H "Authorization: Bearer $TOKEN" 'https://adswipefile.com/api/v1/search?q=protein'
curl -s -H "Authorization: Bearer $TOKEN" 'https://adswipefile.com/api/v1/ads?niche=beauty&format=ugc&limit=5'
curl -s -H "Authorization: Bearer $TOKEN" 'https://adswipefile.com/api/v1/ads?visual_format=testimonial&season=black-friday'Rate limits
60 requests a minute per account, over a sliding window. Every authenticated response says where you stand:
RateLimit-Policy: "account";q=60;w=60
RateLimit: "account";r=59;t=42(RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset carry the same numbers.) Past the limit the answer is 429 with the code rate_limited and Retry-After in seconds.
Allowance: daily on Free, monthly on Starter and Growth
Every MCP tool call (except list_niches, list_formats, list_visual_formats and list_hooks) and every /api/v1 request counts against the account's allowance (UTC): 50 a day on Free, 10,000 a month on Starter, 50,000 a month on Growth, and 200 a day during the free trial of either. A paid month also has a daily ceiling (1,000 on Starter, 3,000 on Growth), so it cannot all go in one day. get_ads counts one call per ad it reads, and on Starter and Growth a list_ads or search_library page counts one call per 10 ads asked for (limit 50 counts 5). Past it, the API answers 429 with the code quota_exceeded and Retry-After set to the reset (UTC: the next midnight on Free, the first of next month on Starter and Growth), and MCP tools answer with a message instead of results; both say when the allowance resets and how to raise it, with the link. See pricing.
Errors
Every error is application/problem+json (RFC 9457), including unknown paths under /api/. Responses are never cached (Cache-Control: private, no-store).
{ "type": "https://adswipefile.com/docs/api#errors", "title": "Not found", "status": 404,
"detail": "No niche with slug \"beuty\".", "code": "not_found",
"resolution": "Find slugs with /api/v1/search?q=<name>, …" }Branch on code (one of not_found, bad_request, unauthorized, forbidden, method_not_allowed, rate_limited, quota_exceeded, not_acceptable, service_unavailable), show detail, follow resolution.
Markdown instead of JSON
Any page URL answers Accept: text/markdown with that page as markdown, at the same URL: curl -H 'Accept: text/markdown' https://adswipefile.com/niches. A client that accepts neither markdown nor HTML gets 406.