Spiral gives your agent every tool with one account. Browse the tools →

Codex · Social Media

How to Use YouTube raw search results in Codex

Returns YouTube search results in their original data structure. Use it when you need to inspect or parse the source response yourself; structured search returns cleaned results.

Prompts to try with YouTube raw search results in Codex

Copy an example into Codex, or ask in your own words.

Use YouTube raw search results for 'Python tutorial' and adapt this project’s parser to the actual response structure.

YouTube raw search resultsCodex
Try asking
  • Use YouTube raw search results to look this up and give me the result as a table. Save the result in ./assets.

  • Pull the latest numbers from YouTube raw search results and tell me what changed since last week.

  • Check YouTube raw search results and summarize what you find in three bullet points.

  • Pull the newest data from YouTube raw search results and give me the result as a table.

How to set up YouTube raw search results in Codex

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the hosted server
    codex mcp add spiral --url https://api.spiral.ai/mcp
  2. Sign in

    Codex opens the browser: sign in to Spiral and click Authorize. No API key. codex mcp list then shows Spiral.

    codex mcp login spiral

Use the Spiral skill

  1. Send Codex this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run YouTube raw search results

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "tikhub",
        "model": "tikhub/youtube-web-v2-get-general-search",
        "input": {
          "search_query": "Python编程"
        }
      }'

Then paste one of the prompts above: Codex finds YouTube raw search results on Spiral, shows the price and runs it.

YouTube raw search results providers and prices

Spiral runs YouTube raw search results through TikHub. Open a card for today's price, with every fee included.

TikHubSocial Media
YouTube Web V2 · General search (raw data, recommend V2)
tikhub/youtube-web-v2-get-general-search

Settings you can ask for

Ask Codex for any of these in your prompt.

SettingAllowed valuesDefaultDescription
YouTubeFeatureAPIlive, 4k, hd, subtitles, creative_commons, 360, vr180, 3d and 3 more

YouTube特征过滤 - API显示版本

YouTubeSearchSortAPIrelevance, upload_date, view_count, or rating

YouTube搜索排序方式 - API显示版本

YouTubeDurationAPIshort, medium, or long

YouTube视频时长过滤 - API显示版本

YouTubeUploadTimeAPIhour, today, week, month, or year

YouTube上传时间过滤 - API显示版本

YouTubeContentTypeAPIvideo, channel, playlist, or movie

YouTube内容类型过滤 - API显示版本

Every API field of YouTube Web V2 · General search (raw data, recommend V2) is on its tool page: open its card above.

What can you do with YouTube raw search results in Codex?

Build a YouTube research report that connects channel references with publishing and community discussion. A coding agent can add the returned data to your project’s tables and implement parsing for raw search responses.

Compare competing channels

Research NASA and ESA publishing: resolve channel identities, compare descriptions, discover relevant search results, and review videos, Shorts, and community announcements. Read post comments and replies for recurring audience questions, then attach recognizable channel links to the comparison.

Prepare a product launch briefing

Build a briefing around a Google product announcement. Confirm the publishing channels and their descriptions, find related coverage through search, inventory videos and Shorts, and examine community announcements with their comment threads. Include channel links so editors can check the sources.

Research creator sponsorship fit

Find public technology channels, reconcile their URLs, and review their descriptions and publishing topics. Compare video titles, Shorts, community posts, and aggregate discussion themes to prepare a sponsorship shortlist with source links. Use raw or structured search according to the research workflow.

Plan an educational content series

Research Python teaching channels and their public catalogs. Use channel descriptions and identity lookups to organize sources, search for existing lessons, and compare videos with Shorts. Review community posts, comments, and replies for questions worth addressing in a lesson outline.

Check a search parser against cleaned results

Run the same YouTube research query through raw and structured search. Compare the parsed results with the cleaned output to investigate missing content types or extraction errors.

Questions about YouTube raw search results in Codex

Can Codex use YouTube raw search results?

Yes. Add Spiral to Codex as an MCP server, and Codex can find and run YouTube raw search results like any built-in tool.

How much does YouTube raw search results cost in Codex?

$0.0013 per request. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Codex plan is separate.

Do I need a TikHub account to use YouTube raw search results in Codex?

No. Spiral runs YouTube raw search results on its own TikHub account. You sign in to Spiral once and never paste a key.

How long does it take to set up YouTube raw search results in Codex?

About two minutes: add the hosted server, then sign in.

Does Codex wait while YouTube raw search results runs?

YouTube raw search results runs in the background. Codex starts the run, checks on it and gives you the json when it's ready.

Does YouTube search cover private and unlisted videos?

Private videos do not appear in YouTube search. Unlisted videos also stay out of search unless someone adds them to a public playlist.

How fresh are YouTube engagement counts?

YouTube says metrics may take the first few hours after a video is published to appear. Counts on a new upload can therefore be incomplete.

Is a YouTube handle the same as a channel name?

Handles are unique identifiers that start with @ and are distinct from channel names. Each channel can have only one handle.

Do older YouTube custom URLs still work?

Existing custom URLs continue to work and redirect to the channel’s handle-based URL. YouTube no longer allows new custom URLs or changes to existing custom URLs.

Is YouTube content available in every country?

Video owners can restrict availability to certain countries or regions, usually for licensing reasons. YouTube can also block content to comply with local laws.

Get started

Start using YouTube raw search results in Codex

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into Codex:

Set up Codex

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options