Reference

API endpoint reference

Thirteen routes: method, path, parameters with their bounds and defaults, one request, the response fields by name, the codes that route can raise, the ceiling that applies. Bounds and defaults are those of the schema the service publishes at https://apishore.com/api/openapi.json; if this page and that document disagree, the document is right.

Envelope, provenance, shared shapes

Base URL https://apishore.com/api. JSON over UTF-8; Content-Type: application/json on every POST. Authenticate with Authorization: Bearer <APIShore key>, or X-Api-Key as an alternative spelling of the same credential, on every route below except the delete route, policy and health. A tenant in bring-your-own-credential mode also sends its YouTube Data API credential, in X-YouTube-Api-Key: quota and compliance stay attributed to the API client of record, and a request without it answers 401 YOUTUBE_CREDENTIAL_REQUIRED. A channel ID is 22–60 characters starting UC, CC or HC, matching ^(UC|CC|HC)[\w\-]{20,58}$ in every request body field that takes one; there a handle or channel URL is a 422, not a coercion. The {channel_id} in a path and the channel_id query of metrics history are plain strings, so a mistyped or unknown id answers 404 CHANNEL_NOT_FOUND where the route looks the channel up, and an empty series where it only reads the ledger. X-Request-Id is echoed as meta.request_id — quote that value in a support thread.

Every response except GET /healthz is {"data": …, "meta": …}. meta carries api_version (1.0.0), request_id, generated_at, service (provider, base_url, docs), tenant (id, plan, mode, limits = the ceilings in force; reported by the routes that read them for this call), credential (fingerprint, not_logged), upstream (provider, calls_made_by_this_request, cache_hits_this_request, search_units_spent, other_units_spent, budget_today), provenance, data_gaps (not_available_from_youtube, why, null_means, rank_history), retention (statistics_max_age_days, text_personal_max_age_days, derived_metrics_amendment_accepted), notes, disclosure, branding, licensing_notice. A null field means the value is not published: absent, never zero, never an estimate. The two upstream counters are separate: search_units_spent rises by one per search page and other_units_spent by one per non-search call; a read served from the cache is counted in cache_hits_this_request and spends nothing.

meta.provenance.by_path maps a dotted path (channels[].subs) to one of four labels, so you can tell field by field what is safe to publish: youtube_api unmodified value returned by YouTube; derived_by_vendor our calculation from public fields, not a YouTube metric; caller_supplied your request parameter, echoed; platform_operational ledger, cache and quota counters about this call. Retention ceilings are identical on every plan and come back per response: 30 days for public text and any contact address, 30 days for counts by default, 1080 days where the derived-metrics amendment is accepted.

What a response can contain

Responses include any email address or link that the channel itself publishes in its public channel or video description. Nothing behind a login is read or returned, and an address can be removed platform-wide through POST /v1/personal-data/delete.

channel channel_id, title, handle, url, country, subs, subs_hidden, total_views, video_count, created_at, uploads_playlist, links[] (url, label), description (first 1200 characters, addresses replaced with [redacted-email]), contact, contact_route. Discovery adds matched_videos, keywords_matched, relevance, best_rank_in_results; with_fit adds fit (score, reasons, hook_line, views_per_sub, cadence_days, recent_vs_lifetime).
contact email, role, confidence (0–1), evidence, source_url, source_kind (channel | video), obfuscated, alternates[], all_contacts[]; each entry also carries published_by_owner, personal_data and do_not_contact. contact_route is email, website_contact_form, youtube_comment_ask or unreachable — branch on it, not on an empty email.
upload video_id, title, url, published_at, views, likes, comments, duration_seconds, definition, caption, description (first 1500 characters, redacted), contacts_in_description[].
video video_id, title, channel_id, channel_title, url, published_at, rank_in_results, keyword, description_excerpt (first 300 characters, redacted).

Plan ceilings

Ask for more than a term allows and the route either reduces the request and records the sentence in meta.notes (discovery) or refuses it with a 403 naming the limit (history depth, comment text). Bounds that come from the request models rather than the term are identical on every plan: pages 1–3, limit and uploads 1–50, channel_ids 1–200, keywords ≤12, days ≤1080. A subscription issued without a limits block falls back to the model defaults — 60 requests per minute, 3 pages, 500 channels, no tier cap on history depth — never to zero. The channel ceiling engages only on a non-zero limit_channels: 0 asks for no cap, so the list is as long as the pages walked and min_matches allow.

CeilingMonthlyQuarterlyHalf-yearlyAnnual
Requests per minute (rpm)3060120240
Search pages per call (pages)1233
Channels per call (limit_channels, when non-zero)100200300500
Metrics history (days)30909090
with_comments on the report payloadnonoyesyes

Error shapes and codes

Two shapes. A status raised inside a route keeps the envelope: {"error": {"code": …, "message": …}, "meta": {…}}, so one parser handles success and failure. A value rejected before the route runs is a FastAPI validation report: {"detail": [ … ]}, an array with one object per offending field, each carrying type, loc, msg and input, and no error key and no meta. The authenticated set — UNAUTHORISED, YOUTUBE_CREDENTIAL_REQUIRED, RATE_LIMITED and 422 validation — applies to every route that takes a key. The fetch set — QUOTA_BUDGET_EXHAUSTED, UPSTREAM_QUOTA_EXCEEDED and UPSTREAM_ERROR — applies on top of it only where the route calls the provider: discover, the three channel routes, report-payload and metrics/snapshot. The per-endpoint lines name only what is additional to these.

404 from a route · 422 from validation
{ "error": { "code": "CHANNEL_NOT_FOUND", "message": "no public channel record for that id" },
  "meta": { "request_id": "b83f1c0d77ae49f2", "api_version": "1.0.0", "service": { … } } }
{ "detail": [ { "type": "string_pattern_mismatch", "loc": ["body", "order"],
                 "msg": "String should match pattern '^(relevance|date|viewCount|title)$'",
                 "input": "views" } ] }
CodeStatusMeaning
UNAUTHORISED401Missing or unknown APIShore key.
YOUTUBE_CREDENTIAL_REQUIRED401The APIShore key is valid, but the request carried no YouTube Data API credential, which a bring-your-own-credential tenant must send.
RATE_LIMITED429The plan's requests-per-minute ceiling, enforced here rather than by the provider. The response carries the Retry-After and X-RateLimit-Limit headers, and retry_after_seconds inside the error object.
QUOTA_BUDGET_EXHAUSTED429This service refused the fetch before sending it, because that call class is spent on the current Pacific quota day: 100 search pages and 10,000 other calls, per credential. The error object carries budget, retry_at and retry_after_seconds; sleep to retry_at — midnight Pacific, not the next UTC midnight.
UPSTREAM_QUOTA_EXCEEDED429The request was sent and the provider refused it for the day; the credential is then marked exhausted, so later fetches are refused before being sent.
UPSTREAM_ERROR502The provider did not answer; nothing was cached from the attempt.
CHANNEL_NOT_FOUND404No public channel record. Not raised by POST /v1/channels:batch, where absent IDs come back in data.not_found.
NOT_FOUND404A path this API does not implement, answered as JSON, not the website's 404 page.
PLAN_LIMIT_HISTORY403days exceeds the term. The error object carries plan_limit_days and an upgrade note; the message names the value asked for.
PLAN_LIMIT_COMMENTS403with_comments is outside the term. The error object carries package. Send with_comments: false.
INVALID_UPLOADS_PLAYLIST422uploads_playlist does not begin UU.
UPLOADS_PLAYLIST_UNAVAILABLE409The channel exists, but YouTube publishes no uploads playlist for it, so its series and fit cannot be read. Different from INVALID_UPLOADS_PLAYLIST, which is about the ID you sent.
SUBSCRIPTION_EXPIRED403The paid term recorded against your key ended; the message names the date. The key works again the moment the renewal is recorded by the provider.
PLAN_REQUIRED403The route you called is provider-side and is not part of any customer term. Your own usage and quota are at GET /v1/quota.
INVALID_EMAIL422The address fails ^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$. Raised only by POST /v1/personal-data/delete.

POST /v1/discover

Keyword → videos → unique channels, with contacts and optional fit; one call replaces the search, channel-lookup, uploads and statistics round trips. Authenticated.

FieldTypeDefaultMeaningClamp
keywordstring 2–120requiredSearch term.—
pagesint 1–31Pages of 50 results to walk. Each page is one search.list call.1/2/3/3
orderenumrelevancerelevance | date | viewCount | title.—
published_daysint 0–36500Videos published within N days; 0 is no date filter.—
regionstring ≤2""Two-letter region code biasing results, e.g. US.—
languagestring ≤8enAccepted and bounded, but this build does not forward it: the search always sends relevanceLanguage=en.—
min_subsint ≥00Subscriber floor; channels outside the window move to data.dropped.—
max_subsint ≥110000000Subscriber ceiling.—
with_contactsbooleantrueExtract addresses from public descriptions; gates the subscriber window.—
with_fitbooleanfalseAdds fit, at two calls per channel scored — one for the upload list, one for its statistics. Only channels whose contact_route is email are scored.—
min_matchesint 1–201Keep channels matched by at least this many results.—
limit_channelsint 0–50000 (the default) asks for no cap and returns every channel that passed min_matches. Any other value caps the list and is reduced to the plan ceiling when above it — noted in meta.notes, not rejected.100/200/300/500
Request
curl -X POST https://apishore.com/api/v1/discover \
  -H "Authorization: Bearer $APISHORE_KEY" -H "Content-Type: application/json" \
  -d '{"keyword":"home coffee roasting","pages":2,"min_matches":2,"limit_channels":60,
       "order":"viewCount","published_days":365,"region":"US","with_fit":true}'

data: keyword (echo), videos[], channels[] in the channel shape, channels_matched (unique channels surfaced, before filtering), channels_returned (length of channels), dropped[] (channel_id, reason = subs_out_of_range, subs; first 50 only), fit_skipped (derived_by_vendor: how many email-reachable channels were left unscored because YouTube exposes no uploads playlist for them; only present meaningfully when with_fit is true), dedupe_ratio (derived_by_vendor, 2 decimals): videos divided by the unique channels in the result set — how many results each channel contributed on average, so it is always at least 1. Near 1 means the keyword is spread across many channels; 3 or more means the same few channels dominate the page.

Errors: 422 validation; plus the authenticated set. Ceiling: pages and limit_channels by term; a reduction is written to meta.notes, e.g. "pages 3 -> 1 (plan limit)". The channel ceiling engages only on a non-zero limit_channels, so asking for 0 can return more than the term's channel figure. Cost: each page is one search.list call. The provider prices it at 100 quota units from the credential's 10,000-per-day pool and separately caps search at 100 requests a day, which is why this API reports search pages and other calls as two counters, search_units_spent and other_units_spent. A non-search call costs 1 unit: the channel lookup adds one channels.list call per 50 IDs, and with_fit adds two calls per channel scored. A read served from the cache costs nothing.

GET /v1/channels/{channel_id}

One channel row: identity, counts, uploads playlist ID, links, any published contact. Authenticated.

ParameterInTypeDefaultMeaningClamp
channel_idpathstring, unvalidatedrequiredChannel ID in UC/CC/HC form. The path segment is not pattern-checked, so a handle, a URL or an unknown id answers 404 CHANNEL_NOT_FOUND, not 422.—
Request (pass -g so curl leaves the braces alone)
curl -g https://apishore.com/api/v1/channels/{channel_id} \
  -H "Authorization: Bearer $APISHORE_KEY"

data: channel in the channel shape. subs is null when the owner hides the count, which subs_hidden states separately from a channel with no published total.

Errors: CHANNEL_NOT_FOUND, 422 validation; plus the authenticated set. Ceiling: requests per minute only. Cost: one channels.list call, 1 unit.

POST /v1/channels:batch

The channel row for up to 200 IDs in one call. One channels.list request is made per 50 IDs, so 200 IDs is four calls. Authenticated.

FieldTypeDefaultMeaningClamp
channel_idsarray of string 22–60, 1–200requiredChannel IDs. An empty array, a 201st entry or a handle in place of an ID is a 422.200, every term
Request
curl -X POST https://apishore.com/api/v1/channels:batch \
  -H "Authorization: Bearer $APISHORE_KEY" -H "Content-Type: application/json" \
  -d '{"channel_ids":["UCALPHA0000000000000000","UCBETA00000000000000000"]}'

data: channels[] (same shape as GET /v1/channels/{channel_id}), requested, returned, not_found[] — the IDs sent that have no public record. returned is the length of channels[].

Errors: 422 validation; plus the authenticated set. Ceiling: 200 IDs per request on every term. Cost: 1 unit per 50 IDs.

GET /v1/channels/{channel_id}/videos

The per-video series — views, likes, comments, duration, dates — newest upload first. Authenticated.

ParameterInTypeDefaultMeaningClamp
channel_idpathstring, unvalidatedrequiredKept in the path even when uploads_playlist is sent, so a stale playlist ID cannot return another channel's uploads under this name. The segment is not pattern-checked, and no lookup happens when uploads_playlist is set.—
limitqueryint 1–5025Uploads to return.50, every term
uploads_playlistquerystring ≤40""The UU… ID from a previous channel row. Skips the channel lookup, so the call count is two instead of three.—
with_contactsquerybooleantruefalse returns each upload with an empty contacts_in_description, for chart-only integrations.—
Request
curl -g "https://apishore.com/api/v1/channels/{channel_id}/videos?limit=50&with_contacts=false" \
  -H "Authorization: Bearer $APISHORE_KEY"

data: channel_id, uploads[] in the upload shape, returned, uploads_playlist_used, channel_verified (true only when the channel row was fetched on this call, i.e. no uploads_playlist was passed). meta.notes repeats that the order is the uploads order and not a ranking.

Errors: INVALID_UPLOADS_PLAYLIST, UPLOADS_PLAYLIST_UNAVAILABLE, CHANNEL_NOT_FOUND, 422 validation; plus the authenticated set. CHANNEL_NOT_FOUND is unreachable when uploads_playlist is set, because no lookup is made. Ceiling: 50 uploads. Cost: three calls, 3 units; two when a valid uploads_playlist skips the channel lookup.

POST /v1/report-payload

Channel row, upload series, keyword positions and derived figures in one response. Text fields are 30-day data; the count series is what a caller may keep as history. Authenticated.

FieldTypeDefaultMeaningClamp
channel_idstring 22–60requiredChannel to report on.—
uploads_playliststring ≤40""The UU… ID of the playlist to read. The call count does not change here — the channel row is fetched either way, because the contact fields come from it — so this only chooses which playlist is read.—
keywordsarray of string, ≤12[]Terms whose first result page is checked for this channel's position; one search page (one search.list call) each.12, every term
uploadsint 1–5025Recent uploads to include in the series.50
with_commentsbooleanfalseAdds comment_text: the top-level comments of the newest upload, text only, from one commentThreads call.half-yearly +
Request
curl -X POST https://apishore.com/api/v1/report-payload \
  -H "Authorization: Bearer $APISHORE_KEY" -H "Content-Type: application/json" \
  -d '{"channel_id":"UCALPHA0000000000000000","uploads":30,
       "keywords":["home coffee roasting","best burr grinder"],"with_comments":false}'

data: channel, uploads[], keyword_positions (keyed by the keyword as sent, each with rank and results_checked; rank null means not on the page that was checked, not below 50), derived (source, median_views, fit_score, fit_reasons, views_per_sub, cadence_days, recent_vs_lifetime, like_rate_pct, hook_line — all derived_by_vendor), comment_text (20 strings, else null). meta.data_gaps adds historical_keyword_rank_before_this_call.

Errors: INVALID_UPLOADS_PLAYLIST, UPLOADS_PLAYLIST_UNAVAILABLE, PLAN_LIMIT_COMMENTS, CHANNEL_NOT_FOUND, 422 validation; plus the authenticated set. Ceiling: with_comments from the half-yearly term. Cost: three non-search calls — channel row, upload list, upload statistics — plus one search page per keyword, plus one call when with_comments is true.

POST /v1/metrics/snapshot

Store a count-only series for later growth analysis. No titles, descriptions or contact data is written here, which is what lets a stored history outlive text. Authenticated.

FieldTypeDefaultMeaningClamp
channel_idsarray of string 22–60, 1–200requiredChannels to capture; one observation per channel per day.200
snapshot_labelstring ≤60""Your own tag, e.g. weekly. Stored inside the row; it does not add a second row for that day.—
Request
curl -X POST https://apishore.com/api/v1/metrics/snapshot \
  -H "Authorization: Bearer $APISHORE_KEY" -H "Content-Type: application/json" \
  -d '{"channel_ids":["UCALPHA0000000000000000"],"snapshot_label":"weekly"}'

data: snapshots[] (captured_at, channel_id, subs, total_views, video_count, snapshot_label, credential), count (lower than the IDs sent when a channel has no public record), retention_days, amendment_required_for_long_history. Re-running the same day overwrites rather than appending: two rows for one date corrupt every growth figure downstream.

Errors: 422 validation; plus the authenticated set. Ceiling: 200 IDs per request. Cost: one channels.list call per 50 IDs, 1 unit each.

GET /v1/metrics/history

The snapshots stored for one channel, oldest first, with growth between the endpoints. Authenticated.

ParameterInTypeDefaultMeaningClamp
channel_idquerystring 8–40requiredChannel whose series you want; the bound is the stored-field length, not the ID pattern.—
daysqueryint 1–108030How far back to read, in days from now.30/90/90/90
Request
curl "https://apishore.com/api/v1/metrics/history?channel_id=UCALPHA0000000000000000&days=90" \
  -H "Authorization: Bearer $APISHORE_KEY"

data: channel_id, series[] (date, subs, total_views, video_count), points, growth (subs_per_day, views_per_day, window_days, source, caveat), history_starts. growth is null below two points; window_days is the gap between the first and last capture, not the days asked for. meta.data_gaps always carries historical_data_before_first_snapshot here.

Errors: PLAN_LIMIT_HISTORY, 422 validation — the plan ceiling is a refusal, not a silent truncation; plus the authenticated set. This route reads the ledger only, so the fetch set cannot arise here. Ceiling: days by term; a subscription issued without a limits block has no tier cap.

GET /v1/usage

Your own request ledger for a window: calls, cache state, units spent upstream, average latency, by route. Authenticated.

ParameterInTypeDefaultMeaningClamp
daysqueryint 1–36530Length of the look-back window.365, every term
Request
curl "https://apishore.com/api/v1/usage?days=30" -H "Authorization: Bearer $APISHORE_KEY"

data: tenant, window_days, calls, cached_calls, cache_hit_rate (null with no calls in the window), upstream_search_units, upstream_other_units, avg_latency_ms, by_endpoint (keyed by method and full path, ordered by volume), billed_note. Every value is platform_operational, so meta.provenance.by_path is empty and meta.provenance.note says why.

Errors: 422 validation; plus the authenticated set. Ceiling: none beyond requests per minute. No provider call, so the fetch set cannot arise here.

GET /v1/quota

The remaining daily budget for each call class and the instant the counters reset, so volume can be planned before a job rather than read off a 429. Authenticated; no parameters.

Request
curl https://apishore.com/api/v1/quota -H "Authorization: Bearer $APISHORE_KEY"

data: cred, day, search_used, search_cap, search_remaining, units_used, units_cap, units_remaining, exhausted, note, caps (search_units_per_day, other_units_per_day, source), extension, day_timezone (America/Los_Angeles), next_reset_at, seconds_until_reset, resets. Two counters, one per call class: search_used rises by one per search page against search_cap 100 a day, and units_used by one per non-search call against units_cap 10,000, both per credential and per Pacific quota day. The provider prices that same search separately at 100 quota units of its 10,000-unit pool, so these two figures are this service's pre-flight ledger, not the provider's remaining balance. exhausted is set when the provider has already refused the credential for the day; while it is true, further fetches are refused before being sent. The caps are the provider's allocation, which no plan changes — do budget arithmetic against this response, not a constant.

Errors: UNAUTHORISED, YOUTUBE_CREDENTIAL_REQUIRED and RATE_LIMITED only — there is no parameter to reject and no provider call. Ceiling: none; the quota day rolls at midnight Pacific Time, not UTC.

POST /v1/personal-data/preview

How many stored responses contain one address, without returning any of them. The count spans every tenant, which is the scope a deletion covers. Authenticated.

FieldTypeDefaultMeaningClamp
emailstring ≤254requiredAddress to look for; matched case-insensitively after trimming.—
reasonstring ≤120subject_requestWhy the lookup is made. Recorded, not returned.—
Request and data
curl -X POST https://apishore.com/api/v1/personal-data/preview \
  -H "Authorization: Bearer $APISHORE_KEY" -H "Content-Type: application/json" \
  -d '{"email":"alina@alphatravel.com"}'
{ "responses_containing_address": 7, "suppressed_already": false }

suppressed_already is true when the address is already on the suppression list, in which case a later crawl of the same public page will not put it back.

Errors: 422 validation; plus the authenticated set. The address form is not checked here, so INVALID_EMAIL cannot arise. Ceiling: none. Scans stored rows; no provider call.

POST /v1/personal-data/delete

Remove one person's address from every stored response and suppress it against later crawls. Unauthenticated and unmetered by design: the person exercising the right is not a billable caller, and their address must never land in a usage row.

FieldTypeDefaultMeaningClamp
emailstring ≤254requiredAddress to purge; must satisfy ^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$.—
reasonstring ≤120subject_requestRecorded with the suppression entry.—
Request — no key
curl -X POST https://apishore.com/api/v1/personal-data/delete \
  -H "Content-Type: application/json" -d '{"email":"someone@example.com"}'

data: suppressed, responses_redacted, responses_still_containing_address, scope ("every cached row, not only contact rows"), sla ("policy allows 7 days, executed synchronously"). Rows are redacted in place rather than deleted, because one cached response is shared across tenants and only the requester's own address comes out of a description. The envelope here is the short one: request_id, api_version, service, generated_at, sla.

Errors: INVALID_EMAIL, 422 validation — and nothing else: the route takes no key, so the authenticated codes beyond validation do not apply, and it makes no provider call. Ceiling: none; no plan, rate ceiling or metering applies here.

GET /v1/policy

The machine-readable statement of what this API cannot do and what it may not be used for, so a client can check it instead of a document. No authentication; no parameters.

Request
curl https://apishore.com/api/v1/policy

data: not_available_from_youtube (11 entries, including click_through_rate, search_volume_for_keywords, audience_retention_curve, protected_email_address), retention (text_titles_descriptions_links_contacts_days 30, statistics_days_default 30, statistics_days_with_derived_metrics_amendment 1080, amendment_accepted_for_this_deployment, enforcement), quota_day (timezone, resets, search_list_calls_per_day 100, other_units_per_day 10000, invalid_requests_still_cost, extension, source), prohibited_patterns[] (6, each naming its rule), permitted_product_shapes[] (5), email_reality (protected_button, public_description_yield_measured, implication) — public_description_yield_measured is the measured share of channels that publish an address. The envelope here is the short one: api_version, service, policy_sources, checked_on, request_id, generated_at, authenticated: false.

Errors: none raised by the route: it reads no store, calls no provider and takes no key. Ceiling: none; the response is the same on every term.

GET /healthz

Liveness for a monitoring probe. The one documented exception to the envelope rule: the body is flat, so anything from curl to an uptime checker can parse it. No authentication, no metering, no parameters.

Request and flat 200
curl https://apishore.com/api/healthz
{ "status": "ok", "provider": "APIShore.com", "base_url": "https://apishore.com/api",
  "version": "1.0.0", "tenants": 11, "db": "api.db", "cache": 0 }

db is the ledger's file name, never a path; cache is the running hit count; tenants is how many credentials the process loaded. status is the field to assert on; the others change with the deployment.

Errors: a non-200 means the process is not answering; there is no error envelope to parse. Ceiling: none.

Route list in machine-readable form: https://apishore.com/api/openapi.json. For a first call see the documentation; for prices, plans and prices; to report a disagreement between this page and the live service, support@apishore.com with the meta.request_id attached.