# YouTube Search API – Scraper, Rank Tracker & Video Data (`rowfeed/youtube-search-api`) Actor

Get the videos YouTube shows for any keyword and country: position, title, views, upload date, length, Shorts flag and channel, plus where your channels rank. A YouTube search scraper and YouTube rank tracker, no API quota or key needed.

- **URL**: https://apify.com/rowfeed/youtube-search-api.md
- **Developed by:** [Rowfeed](https://apify.com/rowfeed) (community)
- **Categories:** Videos, SEO tools, Marketing
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Search API – Scraper, Rank Tracker & Video Data

Get the videos YouTube shows for any keyword, as a viewer in any country: position, title, views, upload date, length, Shorts flag, badges and channel for every video. Add your own channels (or competitors') and get where they rank for each keyword.
Built for YouTube SEO and content research, agencies tracking client channels, brands watching who owns their keywords on YouTube, and AI agents that need YouTube search results as clean JSON. No YouTube API key, no daily quota, no browser.

### What you get

- **One row per video** in YouTube's order: `position`, `title`, `url`, `video_id`, `views`, `published_at` (and YouTube's own "3 weeks ago" text), `duration_seconds`, `is_shorts`, `is_live`, `badges` (e.g. "4K", "5 products"), `description` snippet and `thumbnail_url`.
- **The channel behind each video:** `channel_name`, `channel_url` and `channel_id`, so you can group, filter and track.
- **Channel rank tracking (free):** list channels in `trackChannels` and get one extra row per keyword and channel with its best position, all positions and how many of its videos are in the results.
- Shorts can be left out with one switch.

### Example output

```json
{
  "row_type": "video",
  "keyword": "best running shoes",
  "position": 1,
  "title": "The Most Durable and Long Lasting Running Shoes in 2026!",
  "video_id": "kmZCzZBXAHA",
  "url": "https://www.youtube.com/watch?v=kmZCzZBXAHA",
  "channel_name": "Ben Parkes",
  "channel_url": "https://www.youtube.com/@BenParkes",
  "channel_id": "UCZPqG0yh_xPm2AyLjffbDvw",
  "views": 297259,
  "published_at": "2026-10-11 15:41:51 +00:00",
  "published_text": "3 weeks ago",
  "duration_seconds": 1162,
  "is_shorts": false,
  "is_live": false,
  "badges": ["5 products", "4K"],
  "location": "United States",
  "checked_at": "2026-11-01T15:41:45+00:00"
}
```

Channel rank row for the same search:

```json
{
  "row_type": "channel_rank",
  "keyword": "best running shoes",
  "channel": "@RunnersWorld",
  "best_position": 10,
  "positions": [10],
  "videos_in_results": 1,
  "results_checked": 20
}
```

### Input

| Field | What it does |
|---|---|
| `keywords` | What to search on YouTube, one per line. Up to 1,000 per run. |
| `maxResults` | Videos per keyword, in YouTube's order. 1 to 200, default 20. |
| `location` / `language` | Search as a viewer in this country and language, e.g. `United States` / `English`, `Germany` / `German`. |
| `includeShorts` | Keep Shorts (default) or regular videos only. |
| `trackChannels` | Optional: `@handle`, channel URL or channel ID (`UC...`). Gives a free rank row per keyword and channel. |

### Pricing

Pay per event, no subscription:

- **$1 per 1,000 videos** ($0.001 per video row).
- $0.003 per keyword for every 20 videos requested (so $0.003 at the default 20, $0.03 at 200), also when YouTube shows fewer videos. Failed searches are free.
- $0.001 per run start. Channel rank rows are free.

Examples: 1 keyword with 20 videos costs $0.024. 100 keywords with 20 videos each cost $2.30.
Cap the cost of a run with the maximum charge setting; the Actor never starts a search the budget cannot pay for.
**Try it for $0.001:** the pre-filled example is answered from a saved snapshot of a real search (rows carry `from_snapshot: true`). Change anything and the search runs live.
Live searches need a paid Apify plan (any plan); the pre-filled example works on the free plan.

### Good to know

- Results come through a licensed data provider (DataForSEO) that searches YouTube from the chosen country, so they show the general results, not one person's personalised feed.
- `published_at` is worked out from YouTube's "3 weeks ago" text, so it is exact to the day for recent videos and approximate for old ones.
- YouTube mixes playlists and channels into some result pages; only videos are returned and counted, so a keyword can give a few videos fewer than `maxResults`.
- Channel logos are left out on purpose.

### More tools from Rowfeed

- [YouTube Transcript API](https://apify.com/rowfeed/youtube-transcript-api) – the full transcript and captions of any video found here.
- [Keyword Research Tool](https://apify.com/rowfeed/keyword-search-volume) – search volume, CPC, keyword difficulty and keyword ideas for Google and Bing.
- [Google Trends API](https://apify.com/rowfeed/google-trends-explorer) – interest over time, regions and rising searches, also for YouTube search.
- [SERP API & Rank Checker](https://apify.com/rowfeed/google-serp-api) – Google results for any keyword and country, with your domain's position.
- [AI Visibility Tool](https://apify.com/rowfeed/ai-search-visibility-tracker) – is your brand named and cited by ChatGPT, Gemini, Perplexity and Google AI Mode.

Not affiliated with YouTube or Google.

# Actor input Schema

## `keywords` (type: `array`):

What to search on YouTube, one keyword per line. Up to 1,000 per run.

## `maxResults` (type: `integer`):

How many videos to return per keyword, in the order YouTube shows them. Up to 200.

## `location` (type: `string`):

Search as a viewer in this country, e.g. "United States", "United Kingdom", "Germany".

## `language` (type: `string`):

YouTube interface language, e.g. "English", "German".

## `includeShorts` (type: `boolean`):

Keep YouTube Shorts in the results. Turn off for regular videos only.

## `trackChannels` (type: `array`):

Channels whose position you want per keyword: @handle, channel URL or channel ID (UC...). Adds one free summary row per keyword and channel.

## Actor input object example

```json
{
  "keywords": [
    "how to make sourdough",
    "iphone 17 review"
  ],
  "maxResults": 20,
  "location": "United States",
  "language": "English",
  "includeShorts": true,
  "trackChannels": [
    "@mkbhd",
    "https://www.youtube.com/@LinusTechTips"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "best running shoes"
    ],
    "location": "United States",
    "language": "English",
    "trackChannels": [
        "@RunnersWorld"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfeed/youtube-search-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keywords": ["best running shoes"],
    "location": "United States",
    "language": "English",
    "trackChannels": ["@RunnersWorld"],
}

# Run the Actor and wait for it to finish
run = client.actor("rowfeed/youtube-search-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": [
    "best running shoes"
  ],
  "location": "United States",
  "language": "English",
  "trackChannels": [
    "@RunnersWorld"
  ]
}' |
apify call rowfeed/youtube-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rowfeed/youtube-search-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TDuyd9Xy4htfkPO3h/builds/PVxVOSJSC3PGjNnS1/openapi.json
