youtube

Search YouTube

Searches YouTube by keyword. Returns matching videos, shorts, and live streams (an untyped search returns all three; type scopes to one kind, including channels and playlists). Each video result includes title, URL, thumbnail, view count, publish date, duration, channel info, and badges. DATES: post.published_at is exact by default. Without includeExtras=true the upstream sends only a date it derived from a relative label such as "4 months ago" (measured up to four months off), so every such row is joined to the per-video lookup for its exact publish second, at no extra credit (one lookup per page, about 0.2 to 0.7 seconds). A row the lookup could not resolve keeps the estimate, marked by post.ext.published_precision, and _warnings says so (exact_dates_partial or exact_dates_unavailable). Send exact_dates=false to skip the lookup and get the supplier's estimate with that marker. Durations for Shorts need includeExtras=true. Send include=engagement to fill likes, comments, the duration, the exact publish time and the channel id on every video and Short in the same call from the per-video lookup (faster than includeExtras, and it keeps the full page), and include=channel to add each channel's subscriber count (post.ext.author_followers); each costs 1 credit per distinct video or channel filled, at most 5 per page. TITLES: the free per-video lookup swaps YouTube's English machine-translated listing title for the creator's own; a title not swapped carries post.ext.title_maybe_translated: true (exact_dates=false skips the lookup).

get/youtube/search

Request

  • Base URL: https://www.socialcrawl.dev/v1
  • URL: https://www.socialcrawl.dev/v1/youtube/search
  • Auth: API key in header x-api-key

Query parameters

querystring required

Search keyword or phrase.

uploadDate'today' | 'this_week' | 'this_month' | 'this_year'

Upload date filter. Reliable on its own (no type). With type=shorts, windows narrower than this_year are rejected with a 400 because YouTube returns an empty set for them; this_year is accepted but measured to return ~5x fewer unique Shorts across a paginated walk (the upstream re-serves the same items under an advancing continuationToken), so the recommended pattern for Shorts recency is no uploadDate at all plus includeExtras=true and a client-side filter on post.published_at. With other type values the upstream currently ignores the date filter and may mix content kinds; filter client-side there too. For an EXACT date window rather than these coarse buckets, use /v1/youtube/search/advanced, whose published_after/published_before take RFC-3339 bounds and are genuinely applied.

sortBy'relevance' | 'popular'

Sort order: relevance or popular. popular cannot be combined with type=shorts (rejected with a 400. YouTube serves that combination unreliably); it also caps the page at ~20 results. It is also NOT a strict view-count sort: popular is a popularity-weighted ranking, and results do not come back in descending view order. Measured on 4 of 4 test keywords: a new york search returned 9.5M, then 502.9M, then 66K views in that order. If you need a view-faithful ordering, use /v1/youtube/search/advanced with order=viewCount and includeExtras=true: its ranking leads with the true top results, and the returned engagement.views lets you sort the page exactly client-side.

type'videos' | 'shorts' | 'channels' | 'playlists'

Type of content to return. NOTE on Shorts results (type=shorts, and the Shorts an untyped search mixes in): the Shorts shelf item carries NO channel object upstream (0 of 98 items across 3 keywords on 10/08/2026, 25 of 25 without one on 26/09/2026, raw upstream; includeExtras=true does not add it). By default the free per-video lookup that supplies the exact date also fills post.ext.channel_id and post.author.display_name on those rows, at no extra credit. post.author.username (the @handle) and post.author.avatar_url stay null on them: send include=engagement,channel to fill both and the subscriber count. With exact_dates=false no lookup runs and the whole author stays null on Shorts. Video results are unaffected (20/20 carry the full author). /v1/youtube/search/advanced also carries channel_id on every result at 1 credit, though it has no Shorts filter.

duration'under_3_min' | 'between_3_and_20_min' | 'over_20_min'

Video duration filter. KNOWN UPSTREAM ISSUE: currently not applied by the provider and it can degrade the type filter; prefer filtering client-side on post.content.duration_seconds.

regionstring

2-letter country code of the country to put the proxy in.

continuationTokenstring

Continuation token to get more results. Get continuationToken from a previous response. Native upstream cursor param. Send the universal cursor instead: the API maps it to this name for you.

includeExtrasstring

Set to true to add the like count and comment count (post.engagement.likes / .comments) and the video description (post.ext.description) to each video result. Left off, those three are null. Dates do not need it: post.published_at is exact by default either way (see exact_dates). For Shorts results it additionally supplies post.content.duration_seconds, which those items never carry otherwise. Costs latency and page depth: measured 2387ms and 20 rows without, 9763ms and 16 rows with, on the same query. It does NOT add channel identity to Shorts results (see type) and it never adds a subscriber count. For both, send include=engagement,channel instead: the video join supplies every row's channel id, and the channel join adds the subscriber count, in this same call. For full per-video details use /v1/youtube/video.

includestring

Set to engagement, channel, or both (engagement,channel) to fill more of every row in this one call. engagement fills post.engagement.views, .likes and .comments, post.content.duration_seconds, post.ext.channel_id and post.author.display_name where the row lacks them, and replaces a date derived from a label such as "4 months ago" with the exact publish time (removing post.ext.published_precision). channel puts the channel's subscriber count on post.ext.author_followers (YouTube's own figure, which it rounds to three significant figures above 1,000) and fills the channel's post.author.display_name, .avatar_url and .username where missing. Send both to cover rows that arrive without a channel id: the video join supplies it and the channel join then uses it. Each join costs 1 credit per distinct video or channel it filled, and never more than 5 per 50; ids that could not be filled are refunded. Channel and playlist result rows are not videos: the video join skips them. Each join adds 0.2 to 0.7 seconds on a fresh page (one lookup per 50 ids, never more than 8 seconds). Read data.hydration for the rows, lookups, credits held and kept, and the time.

exact_dates'true' | 'false'

Exact publish dates are on by default and free. A row whose date the upstream derived from a relative label such as "4 months ago" (measured up to four months off) is joined to the per-video lookup for its exact publish second, at no extra credit: one lookup per page (two on a page past 50 rows, side by side), adding about 0.2 to 0.7 seconds (never more than 3). The same lookup swaps the listing title, often YouTube's English machine translation, for the creator's own, and computed.language follows it; a title not swapped carries post.ext.title_maybe_translated: true. Set to false to skip the lookup: rows then carry the supplier's date estimate (a day-granular or coarser label truncated to midnight UTC), marked by post.ext.published_precision and post.ext.published_label, and the listing title, marked by post.ext.title_maybe_translated. A row the lookup could not resolve keeps those values and markers, and _warnings carries exact_dates_partial (some rows) or exact_dates_unavailable (none); on channel/videos, whose dates are already exact, the warnings are original_titles_partial and original_titles_unavailable.

relevance'score' | 'filter'

Optional. Without this param every row already carries computed.relevance against your query, free ({ p, sense, depth, spam }: is this row about what your query means, or a different thing that shares its words?), and nothing is dropped or reordered. score asks for it explicitly and waits for every row; filter also drops the rows that are not about your query, and lists their ids in data.relevance.dropped_ids. Your query is the topic; nothing to configure. A row that could not be judged is never dropped and carries relevance: null. Pagination is unchanged, so a filtered page can hold fewer rows. Free with your query as the topic; with relevant_to it adds 1 credit per started 25 newly judged rows (rows already judged for the same topic are free, and so is a cached page).

relevance_thresholdstring

Optional, only with relevance. The probability (0 to 1) a row must reach to be kept by relevance=filter. Default 0.5. Lower keeps more rows, higher keeps fewer.

relevant_tostring

Optional, only with relevance. Up to 200 characters describing what you mean, used as the topic instead of the query. Use it when the query is ambiguous, for example query=cleopatra with relevant_to=Cleopatra, the IGT slot game.

judgments'on' | 'off'

Optional, on (the default) or off. By default every row gains free SocialCrawl judgments (computed.labels, and computed.relevance on search endpoints), reported in data.labels (mode default) and data.relevance (origin default), each with a status (complete, partial or skipped) and pending: the rows still being judged when the page was sent, which carry null now and are filled on your next call or cached read. Default judgments never add credits, never change an existing field, and never drop or reorder a row. off returns the page exactly as before, with none of those keys. label=none does the same.

dry_run'1'

Optional. When 1, return a cost preview for this labelled or relevance-filtered request without fetching the page or judging any row. data.estimate reports rows_expected, rows_cached, label_credits_min, label_credits_max and base_credits. 0 credits charged.

fit'goal'

Optional. When goal, keep the rows and fields needed for the goal you pass in goal= (plus any that are uncertain, and the first and last), and replace the rest with a stub. data.held_back lists the held ids and a recall id that re-reads the full page from cache at no extra charge. Without this param the page is unchanged.

goalstring

Required by fit=goal. What you are trying to do, in your own words, up to 300 characters.

fit_tokensinteger

Optional, only with fit=goal. Soft cap on how much of the page to keep, in tokens. Uncertain blocks and the first and last block are kept even if they exceed it.

labelstring

Optional CSV of SocialCrawl labels to add to every post. Without this param every page already carries sponsored, intent and niche, free; label= adds the labels you name to them (the defaults keep running). sponsored, intent and niche are free when asked for too; mention, quality, intent with offer=, and injection add 1 credit per started 25 newly judged posts. judgments=off (or label=none) turns the default labels off. sponsored: is the post a paid or gifted promotion (p, 0 to 1), did it carry a disclosure marker such as #ad or 광고 (disclosed), is it likely paid with no marker (undisclosed), and which of the accounts it mentions does it promote (brand, or null). These are signals to review, never a finding. mention (needs brand=): is the post about that brand rather than something that shares its name (about_brand, 0 to 1), how it feels about the brand on five levels (sentiment_level 0 to 4 and sentiment_score 0 to 1, null when the post is not about the brand), is it sarcastic, which aspect it talks about (taste_or_quality, price_or_value, availability_or_delivery, health_or_safety, advertising_or_campaign, customer_service, none), and did the author buy or use it (first_hand). intent: what the author is mainly doing (label: asking_for_recommendation, comparing_options, switching_away, complaining, promoting, news_or_discussion, other, or null when unsure, with confidence), whether they read as a potential buyer rather than a seller (buyer, seller), how pressing the need is (urgency, 0 to 3), and, when you pass offer=, whether your offer would plausibly help them (fits_offer). niche: which of the 33 niches of the published taxonomy sc-niche-v1 the caption belongs to, or personal_no_niche, or other (label, confidence, taxonomy), with label null when the caption is too thin to tell or the pick is unsure. It reads the caption only, not the video. quality: how much checkable detail the caption carries (fact_density 0 to 3), whether it mainly asks for likes, replies, shares, follows or tags (engagement_bait, 0 to 1), whether it is written to provoke anger as a way to get engagement (rage_bait, 0 to 1; about the writing, never the side taken), whether it only repeats someone else's news or view (secondhand, 0 to 1), and what the post is mainly doing (post_aim: inform, opinion, sell, entertain, provoke, other). exclude=engagement_bait drops posts whose engagement_bait is 0.8 or higher. injection flags text that addresses an AI system and tries to direct it (flagged, p); it never drops or rewrites a row. A post that could not be judged carries labels: null. Posts already labelled for anyone are free, and so is a cached page. data.labels reports what was judged and billed.

excludestring

Optional CSV (engagement_bait), only with label=quality. Drops posts whose engagement_bait probability is 0.8 or higher and lists their ids in data.labels.dropped_ids. A post that could not be judged is never dropped.

brandstring

Required by label=mention, ignored otherwise. The brand or product the posts are judged against, up to 300 characters, for example brand=Buldak. Without it label=mention is skipped with the warning label_mention_needs_brand and is not billed.

brand_descriptionstring

Optional, with label=mention. One plain sentence saying what the brand is, for example brand_description=Samyang's spicy instant noodle brand. Use it when the name is also an ordinary word or another company's name.

offerstring

Optional, with label=intent. One or two plain sentences saying what you sell, up to 300 characters, for example offer=A web design agency that builds websites for small businesses. Adds fits_offer to every post; without it fits_offer is null.

label_evidence'1'

Optional, only with label=. When 1, every labelled row also carries computed.labels_evidence.<preset> = { quote, sentence_index }: the sentence in the row that most clearly shows the label, copied verbatim. Absent or null when no single sentence shows it.

sincestring

Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off each page. This list is not in date order, so the walk does not stop at the date: keep following next_cursor, and each page costs what a page costs even when every row on it is filtered out. A row with no date is kept. published_after, start_date, from_date, publish_time (yesterday, this-week, this-month, last-3-months, last-6-months) and max_age_days are accepted and applied as since.

untilstring

Only rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept. published_before, end_date and to_date are accepted and applied as until.

min_viewsinteger

Keep only rows with at least this many views (post.engagement.views). A row whose view count is unknown is discarded, so every returned row meets the floor. Filtering runs on our side after each page is fetched, so every page walked is billed as usual; data.walk.discarded counts what was removed and why.

max_age_daysinteger

Keep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded. Filtering runs on our side after each page is fetched, so every page walked is billed as usual; data.walk.discarded counts what was removed and why.

sort_rows'views'

views: return the kept rows ordered by view count, highest first, across every page walked. Rows without a view count go last.

max_pagesinteger

1 to 5 (default 1). Walk up to this many pages in one call and return the rows from all of them (after any filter). Each page walked is billed exactly as one call to this endpoint (a cached page is free) and counts against your rate limit. The walk stops early at the last page, or when the request's time budget runs low; data.walk.stopped says why (end, max_pages, time_budget, page_error) and data.next_cursor continues from where it stopped.

seenstring

An id you choose (1 to 64 letters, digits, ., _ or -). Rows your account already received under the same seen id are removed from the page, and the page price falls with the share of repeats: page credits x new rows / rows on the page, rounded up, so a page of nothing but repeats is free. Only the page's own price is discounted: credits for joined data (include=) are charged only for rows you have not received, and are never discounted. The memory lasts 24 hours from the last call that used the id, holds row ids only, and is private to your account. Use one id across a set of related searches; data.walk.repeats counts what was removed.

cursorstring

Universal pagination cursor. Send pagination.next_cursor from the previous response back verbatim: the API maps it to this endpoint's native continuationToken (cursor style). You never construct, decode, or look up a cursor. Omit it for page 1.

Headers

Cache-Controlstring

Send no-cache to bypass the response cache and force a live fetch. Billed at the normal endpoint cost; the fresh result is written back to cache for the next caller. Only the no-cache directive triggers this. See the Response Schema guide for details.

Idempotency-Keystring

Optional UUID that makes the request safely retriable. The key is reserved atomically per account before billing. A concurrent retry receives 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After of 1 second while the original is young, growing to a quarter of the time it has been running (at most 30); a crashed reservation expires after 5 minutes. A replay keeps the cached payload immutable except for billing metadata: credits_used becomes 0, idempotent_replay becomes true, and credits_remaining is refreshed to the current balance. A known current balance appears in both the body and X-Credits-Remaining header; no balance row resolves to 0. On a transient lookup failure, body credits_remaining is null and X-Credits-Remaining is omitted. Completed outcomes expire after 24 hours. If the claim store is unavailable, the request fails closed before billing. GET endpoints do not combine idempotent replay with Server-Sent Events: use Accept: application/json when sending this header. The unsupported key-plus-SSE combination is rejected before billing.

Response

Successful response

successboolean required

Whether the request succeeded

platformstring required

Platform name

endpointstring required

API endpoint path

credits_usedinteger required

Number of credits consumed

credits_remaininginteger nullable required

Current account balance, or null when this response could not establish one. Free cache hits always return null because they do not establish an authoritative post-request balance. An idempotency replay also returns null when its current-balance lookup fails. It is never a fabricated zero, so a zero here means the account really is empty. The authoritative reading is the one on a billed response, which comes straight from the deduction.

request_idstring required

Unique request identifier for support

cachedboolean required

Whether the response was served from cache

idempotent_replayboolean

True only when this response is an idempotency replay

Example response

{
  "success": true,
  "platform": "youtube",
  "endpoint": "/v1/youtube/search",
  "credits_used": 1,
  "credits_remaining": 4999,
  "request_id": "req-abc123",
  "idempotent_replay": true,
  "meta": {
    "hint": {
      "code": "search_multi",
      "message": "You searched \"matcha\" on 3 platforms one call at a time; /v1/search/multi returns each platform's own search rows in one call at the same price per platform, and a platform with no rows is not charged.",
      "method": "GET",
      "path": "/v1/search/multi?query=matcha&platforms=instagram,tiktok,youtube"
    }
  },
  "pagination": {
    "next_cursor": "sc.eyJ2IjoyLCJjIjoiMiIsInAiOiJwYWdlIn0",
    "has_more": true,
    "page_size": 30,
    "stopped_at": "known_id"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.