NativeAds AI URL Asset Extraction API
The URL Asset Extraction API from NativeAds AI — 3 operation(s) for url asset extraction.
The URL Asset Extraction API from NativeAds AI — 3 operation(s) for url asset extraction.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/nativeads-ai:nativeads-ai-url-asset-extraction-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: NativeAds Headless URL Asset Extraction API
version: 1.0.0
description: 'The headless REST API for programmatic creative generation. Authenticate with a per-user API key (`Authorization: Bearer nak_...`). This reference lists only the endpoints an API key may call; generation endpoints are asynchronous (submit returns an id, then poll).'
license:
name: Commercial
url: https://www.nativeads.ai/
servers:
- url: https://creative-v1.nativeads.ai/v1
description: NativeAds API Server
security:
- BearerAuth: []
tags:
- name: URL Asset Extraction
paths:
/assets/extract-from-url:
post:
tags:
- URL Asset Extraction
summary: Start extracting assets from a page URL
description: 'Accepts a page URL and starts an asynchronous extraction. Returns immediately with an
extraction id and `status: pending`; no candidates are present yet.
Poll `GET /assets/extract-from-url/{extractionId}` until `status` is `completed` or `failed`.
A typical run takes one to five minutes, depending on how many related pages the site has.
Internal ceilings bound it: a run still `pending` or
`processing` after roughly 10 minutes has exhausted them and lands on `failed`.
Extraction consumes no plan or feature usage. The only volume guard is the per-organization
cap described under 429.'
operationId: extractAssetsFromUrl
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractAssetsFromUrlRequest'
example:
url: https://www.marondahomes.com/oh/grove-city/autumn-grove-43123.html
brandId: 223e4567-e89b-12d3-a456-426614174000
purpose: scene_forge
media: both
responses:
'202':
description: Extraction accepted and queued.
content:
application/json:
schema:
$ref: '#/components/schemas/UrlExtraction'
'400':
description: 'Bad Request. The URL is missing or malformed, its host cannot be resolved, it resolves to
a private, loopback, link-local or otherwise disallowed address, or `media` was set to
`videos`. A rejection here happens before the run is recorded, so it consumes no
rate-limit slot.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: 'Payment Required. The organization is locked out for billing reasons. Both `read_only`
and `full_lockout` block starting an extraction.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Brand not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: 'Too many requests. Two independent limits produce this status. The extraction cap allows
60 runs per organization per rolling hour and counts every recorded run, including ones
that fail or are never committed. The generic per-organization request limiter applies
on top of it and is the only one of the two that sends `Retry-After` and `X-RateLimit-*`
headers.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/assets/extract-from-url/{extractionId}:
parameters:
- name: extractionId
in: path
required: true
description: The extraction returned by the submit call.
schema:
type: string
format: uuid
get:
tags:
- URL Asset Extraction
summary: Read an extraction and its ranked candidates
description: 'Returns the extraction''s current status. Once `completed`, `candidates` holds the ranked
results, best first (`rank` 1 is the strongest match).
Only candidates the ranker kept are returned by default. Pass `includeRejected=true` to see
everything it considered and why it rejected each one. Rejected candidates are staged on the
first run, so asking for them costs no second extraction.
Fields are omitted rather than sent as null. A run that has not completed has no `candidates`
key at all rather than an empty array, so read the response defensively.
Re-reading an extraction also mints fresh candidate preview URLs, which is how you recover
from an expired one.'
operationId: getUrlExtraction
security:
- BearerAuth: []
parameters:
- name: includeRejected
in: query
required: false
description: Include candidates the ranker rejected, for debugging or manual override.
schema:
type: boolean
default: false
responses:
'200':
description: The extraction and, when complete, its ranked candidates.
content:
application/json:
schema:
$ref: '#/components/schemas/UrlExtraction'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: 'Payment Required. The organization is in `full_lockout`. A `read_only` organization can
still read an extraction.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Extraction not found. Reads are scoped to the caller''s organization, so another
organization''s extraction id is reported as not found rather than forbidden.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Too many requests. The per-organization request limiter applies to reads too.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- URL Asset Extraction
summary: Delete an extraction and its staged candidates
description: 'Removes the extraction, its candidates, and the staged copies behind them. Use it to withdraw
a scrape — a page submitted by mistake, or media you no longer want held.
Assets already committed from this extraction are NOT affected. Committing copies the bytes to
a new asset key, so no Asset depends on a staged object; delete those with
`DELETE /assets/{assetId}` instead.
Staged bytes are removed on a best-effort basis: the extraction is gone from the API either
way, and anything the cleanup misses is collected by the storage expiry rule.'
operationId: deleteUrlExtraction
security:
- BearerAuth: []
responses:
'204':
description: Deleted. No body.
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: 'Payment Required. The organization is locked out for billing reasons. Both `read_only`
and `full_lockout` block deleting.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Extraction not found. Deletes are scoped to the caller''s organization, so another
organization''s extraction id is reported as not found rather than forbidden.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Too many requests. The per-organization request limiter applies to deletes too.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/assets/extract-from-url/{extractionId}/commit:
parameters:
- name: extractionId
in: path
required: true
description: The extraction whose candidates are being committed.
schema:
type: string
format: uuid
post:
tags:
- URL Asset Extraction
summary: Commit chosen candidates as assets
description: 'Promotes candidates into real Assets on the extraction''s brand, using the same path as a
direct upload, so the committed files get identical validation and image-quality processing.
A committed image therefore lands as `uploaded` and reaches `complete` only after
processing — poll the asset before referencing it in generation.
Send no body (or an empty object) to commit every KEPT candidate, none of them flagged as a
logo. Commit-all never includes rejected candidates; a rejected candidate can only be
committed by naming its `candidateId` explicitly. Send `items` to choose a subset and flag
individual candidates as logos.
Committing is idempotent per candidate: one that was already committed returns the asset it
produced the first time rather than creating a duplicate.
Committing also deduplicates across this brand''s extractions, by the image''s content. Each
candidate''s staged bytes are hashed (sha256) first, and a candidate whose bytes match an
asset this brand already saved from any extraction, as the same kind of asset (logo or
not), returns that existing asset instead of a copy, and its `committedAssetId` then points
at it. Two candidates with the same bytes in one request make one asset. This covers
captures with no URL of their own, such as an inline SVG, and two different captures that
share their page''s URL stay two assets. An image saved before content matching existed
carries no hash, so it alone is matched by its `http(s)` source URL instead.
`alreadyInLibraryCount` says how many of the returned assets were there before this
request. Only a live asset (uploaded, processing or complete) is reused; a deleted or
failed one never is. An `isLogo` request never reuses a plain image, and a plain request
never reuses a logo; each kind is created once.
Committing is NOT atomic across candidates. They are promoted one at a time in ranked order
and the first failure returns immediately, leaving the earlier ones committed. Retrying the
same request is the correct recovery, and the per-candidate idempotency is what makes that
safe.'
operationId: commitUrlExtractionCandidates
security:
- BearerAuth: []
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/CommitUrlExtractionRequest'
example:
items:
- candidateId: 9f1c2b3a-4d5e-6f70-8192-a3b4c5d6e7f8
isLogo: false
- candidateId: 1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809
isLogo: true
responses:
'200':
description: 'The assets for the chosen candidates: created now, or already on the brand (see
`alreadyInLibraryCount`).
'
content:
application/json:
schema:
$ref: '#/components/schemas/CommitUrlExtractionResponse'
'400':
description: 'Bad Request. A candidate id is malformed, the extraction has not reached `completed`
yet, or the extraction completed with no candidates at all.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: 'Payment Required. The organization is locked out for billing reasons. Both `read_only`
and `full_lockout` block committing.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Extraction not found, or a candidate does not belong to it. A `candidateId` that names
nothing in this extraction fails the whole call rather than being skipped silently.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Too many requests. The per-organization request limiter applies to commits too.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
CommitUrlExtractionRequest:
type: object
properties:
items:
type: array
description: 'The candidates to commit. Omit this field entirely (or send no body at all) to commit
every KEPT candidate with `isLogo` false.
There is no commit-nothing request shape: an empty body means "commit all", so a client
driving this from a user''s selection must not call the endpoint when nothing is
selected.
'
items:
$ref: '#/components/schemas/CommitUrlExtractionItem'
additionalProperties: false
UrlExtractionCandidate:
type: object
required:
- candidateId
- sourceUrl
- mediaType
- kept
- looksLikeLogo
properties:
candidateId:
type: string
format: uuid
sourceUrl:
type: string
format: uri
description: Where the file sits on the original page, kept for provenance.
url:
type: string
format: uri
description: 'A URL for viewing this candidate before you commit it. Render it directly. It points at
the staged copy, not the original page, so it stays valid even if the page changes.
It expires: the lifetime is between 4 and 8 hours from when it was minted, because the
expiry is quantized so the string stays stable and cacheable. Re-read the extraction to
mint a fresh one rather than storing this value.
'
mediaType:
type: string
enum:
- image
- video
width:
type:
- integer
- 'null'
height:
type:
- integer
- 'null'
durationSeconds:
type:
- number
- 'null'
format: float
description: Video candidates only; null for images.
fileType:
type:
- string
- 'null'
description: 'MIME type of the STAGED copy, not of the file on the page. Candidates are re-encoded
before staging, so this is always `image/png` (sources with alpha) or `image/jpeg`
(opaque sources), whatever the page served — AVIF, WebP, HEIC and TIFF sources all
decode and re-encode.
'
relevanceScore:
type:
- number
- 'null'
format: float
description: 'How central this file is to the page''s subject, from 0 to 1, from a vision pass over the
page. If that pass fails it degrades to heuristics only: every image is kept with a
neutral 0.5 and a `relevanceReason` saying so, rather than the run returning nothing.
'
relevanceReason:
type:
- string
- 'null'
description: 'One line explaining the score, capped at 300 characters and safe to show to a user.
'
rank:
type:
- integer
- 'null'
description: 1 is the best match. Candidates are already returned in this order.
kept:
type: boolean
description: 'False only when `includeRejected=true` was passed. A rejected candidate can still be
committed if the caller disagrees with the ranker, but only by naming its `candidateId`
explicitly — a commit with no body never includes rejected candidates.
'
looksLikeLogo:
type: boolean
description: 'The extractor''s own guess that this candidate is the brand''s logo, from the same vision
pass that scored it. Advisory, never authority.
It is NOT the same field as the `isLogo` you send on a commit item. This one says what
the extractor thinks; that one is the user''s decision, and it is the only thing that
sets the asset''s type. Use this to pre-mark a tile or to phrase the question, and do
not commit `isLogo: true` off the back of it without the user saying so — the type is
fixed at creation and cannot be changed afterwards.
'
committedAssetId:
type:
- string
- 'null'
format: uuid
description: 'Set once this candidate has been committed, or once a commit matched it to an asset the
brand already had with the same bytes (or, for an asset saved before that matching
existed, from the same image URL). This is what makes commit idempotent.
'
UrlExtraction:
type: object
required:
- extractionId
- sourceUrl
- media
- status
properties:
extractionId:
type: string
format: uuid
sourceUrl:
type: string
format: uri
purpose:
type:
- string
- 'null'
media:
type: string
enum:
- images
- videos
- both
status:
type: string
enum:
- pending
- processing
- completed
- failed
description: '`pending` and `processing` mean the run is still in flight; keep polling. `completed`
means `candidates` is populated. `failed` means `errorCode` and `errorMessage` explain
why.
'
errorCode:
type:
- string
- 'null'
readOnly: true
description: 'Set only when `status` is `failed`. One of a small fixed set — `WORKFLOW_ERROR` (the run
could not be started, or ended terminally failed), `EXTRACTION_ERROR` (a non-transient
error inside the extraction itself), or the class name of the underlying exception,
e.g. `ValueError` for a blocked or invalid URL caught at fetch time. Treat it as an
open set and read `errorMessage` for the detail.
'
errorMessage:
type:
- string
- 'null'
readOnly: true
truncated:
type: integer
description: 'How many images the page had that this run never scored: heuristic survivors that were
never fetched, because a run stops once it holds enough unique images and will not
exceed its fetch budget. Absent or 0 means nothing was left out.
A non-zero value means the page carried more candidate images than one run scores. It
does NOT mean good matches were withheld: everything scored and kept is in `candidates`,
and near-identical shots the ranker held back are returned as well, with `kept: false`
when you pass `includeRejected=true`.
Images the cheap size and filename filters discard before any fetch are counted nowhere,
so this is not a count of everything on the page.
'
default: 0
candidates:
type: array
description: 'Ranked candidates, best first: by relevance score descending, then by pixel area as a
tie-break. Absent entirely — not an empty array — until the extraction completes. A
page that yields no usable image completes successfully with no candidates.
'
items:
$ref: '#/components/schemas/UrlExtractionCandidate'
createdAt:
type: string
format: date-time
AssetSummary:
type: object
required:
- assetId
- assetType
- previewUrl
- assetUrl
properties:
assetId:
type: string
format: uuid
description: The ID of the asset.
assetType:
type: string
enum:
- image
- logo
- video
- document
- environment
- font
- mask
- model
- text
- walmart_preview
previewUrl:
type:
- string
- 'null'
format: url
description: URL to the preview of the asset.
example: https://cdn.example.com/assets/asset-123e4567-thumb.jpg
assetUrl:
type:
- string
- 'null'
format: url
description: URL to the asset.
example: https://cdn.example.com/assets/asset-123e4567-img.jpg
displayUrl:
type:
- string
- 'null'
format: url
description: A screen-size rendition (2048 px long edge at most) for a full-screen viewer. Never the original file of a large image. Use the full URL only to download.
ExtractAssetsFromUrlRequest:
type: object
required:
- url
- brandId
properties:
url:
type: string
format: uri
maxLength: 2048
description: The page to scrape. Must be a public http(s) URL.
example: https://www.marondahomes.com/oh/grove-city/autumn-grove-43123.html
brandId:
type: string
format: uuid
description: Brand that scopes any assets committed from this extraction.
purpose:
type:
- string
- 'null'
maxLength: 64
description: "Optional hint for what the results will be used for, which tunes how the ranker scores\ncandidates and how many it keeps.\n\nRecognised today:\n * `scene_forge` — biases toward clean, isolated, croppable product shots. Strictest\n keep threshold, and returns **at most 10** kept candidates.\n * `video` — allows scenic and establishing shots. Loosest threshold, up to 40.\n * `any` — no lean, middling threshold, up to 40. This is also what an omitted,\n null, or blank value means.\n\nMatching ignores case, hyphens and spaces, so `Scene Forge` and `scene-forge` both\nreach the `scene_forge` profile.\n\nAnything else is **free text, and is used** rather than discarded: it keeps `any`'s\nthresholds and limit, and the text itself is passed to the ranker as a description of\nintent, so it re-tunes the ordering. `\"Facebook ad creative for first-time buyers\"` is a\nvalid purpose and ranks differently from no purpose at all. It is truncated at 300\ncharacters. Nothing here is ever rejected, so callers do not break as the vocabulary\ngrows.\n"
example: scene_forge
media:
type: string
enum:
- images
- videos
- both
default: both
description: 'What to pull off the page. `both` returns whatever is currently supported and is the
right default for most callers.
Video extraction is not available yet: `videos` is rejected with 400 until it ships.
Until then `images` and `both` behave identically — the ranker only ever reads `<img>`
elements, so every candidate comes back with `mediaType: image`. The value is recorded
on the extraction so the distinction becomes meaningful once video ships.
'
additionalProperties: false
ErrorError:
type: object
required:
- code
- message
properties:
code:
type: string
example: INVALID_REQUEST
message:
type: string
example: Invalid input data provided
details:
description: "Additional error context (optional, can be object or array). Absent on\nmost errors; the message is the only guaranteed human-readable field.\n\nUpload rejections populate it, because a client needs to act on the\nanswer rather than parse it. `POST /v1/assets/initiate-upload` and\n`POST /v1/assets/confirm-upload` return:\n\n- `reason` — `unsupported_declared_type` when the declared MIME type is\n not accepted, or `unsupported_file_contents` when the uploaded bytes\n are a different format than declared (an AVIF saved with a `.jpg`\n name, say). Only confirm-upload can report the second: it is the\n first point that reads the real bytes.\n- `declaredType` — the MIME type the client sent.\n- `detectedFormat` — the format the bytes actually are, on\n `unsupported_file_contents` only.\n- `supportedFormats` — every format an upload may be.\n- `retryable` — `false` on both, meaning the same bytes will be\n rejected again. Clients must not retry these.\n"
example:
reason: unsupported_file_contents
declaredType: image/jpeg
detectedFormat: AVIF
retryable: false
supportedFormats:
- DOC
- DOCX
- GIF
- JPEG
- MP4
- PDF
- PNG
- QuickTime
- TIFF
CommitUrlExtractionItem:
type: object
required:
- candidateId
properties:
candidateId:
type: string
format: uuid
isLogo:
type: boolean
default: false
description: 'Mark this specific candidate as the brand''s logo. This is not only a label. The asset is
created as a logo internally, which skips both the quality assessment and the
image-processing workflow a normally committed image goes through.
The type itself is not on the asset response, but the effect is visible: a logo is
`complete` as soon as the commit returns, where a normal image passes through
`uploaded` first and has to be polled.
Because commit is idempotent per candidate, setting this on a candidate that was
already committed has no effect. Flag it on its first commit. A logo is never matched
to a plain image the brand already has from the same URL, so flagging it creates the
logo even when that image was saved before.
'
additionalProperties: false
Error:
description: Standard error response
type: object
required:
- error
- requestId
properties:
error:
$ref: '#/components/schemas/ErrorError'
requestId:
type: string
format: uuid
description: Unique identifier for the request, useful for tracing.
CommitUrlExtractionResponse:
type: object
required:
- assets
- alreadyInLibraryCount
properties:
assets:
type: array
description: One entry per asset, in ranked order. Existing assets are listed too.
items:
$ref: '#/components/schemas/AssetSummary'
alreadyInLibraryCount:
type: integer
minimum: 0
description: 'How many of `assets` were already on the brand before this request: saved earlier from
one of these candidates, or the same image (the same bytes, or for an older save the
same image URL) in another extraction of this brand. No new asset was created for them, so `assets` minus this count is what this
request added. 0 when everything is new. An asset counted here may already be
`complete`.
'
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT token for authentication.