> ## Content Index
> Fetch the complete content index at: https://serpapi.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Scrape YouTube Shorts videos results
- URL: https://serpapi.com/blog/how-to-scrape-youtube-shorts-videos-results/
- Published: 2024-01-03T04:26:06.000Z
- Updated: 2024-01-04T22:47:11.000Z
- Author: Andy L

YouTube is one of the most popular online video platforms. Videos are published on different topics, such as music, entertainment, education, news, sports, and more.

YouTube also has a feature called shorts, vertical videos, 60 seconds long and can be created and watched on mobile devices. YouTube shorts are similar to TikTok videos and Instagram Reels.

![](https://lh7-us.googleusercontent.com/SthN-vX8CDYdZ5QiFP55Ds1maAFppKIiFjTrRoGVhEQ-jZKfaXLNtcmlTGA71uePPJIy3VQJOKJxi-SvTsDshLYJuddp5WzZabOOIEPVt_eSgYD1m1MIpmuA5z3oNLgIVEoFsnYgjdDDhJZityJfol4)

YouTube short video results can be very helpful for data analysis, content creation, marketing research, or personal interest.

YouTube has dynamic web pages. YouTube also has anti-scraping: captchas, IP blocking, and rate limiting that can prevent you from scraping large data you want.

By using SerpApi, you don't need to worry about these noises. [SerpApi](https://serpapi.com/) provides high-quality and reliable results for Youtube Search Results and other platforms. You can customize your searches by using keywords, country, location, language, etc.

![](https://lh7-us.googleusercontent.com/BKwDdd66Vda5pU-3L-5Ywt5ZhcQHwIQPL7aR6DKkuzmvtUG83I5bJP3vUzFE1nOecL1R4v5tQdQ0Z5KnzHsYoe_upR-DU1oxesIIooQApEKEqIl3uVrqYO7_JZRShnJN2JYjmmI_HF3B3q7d9J2A2hA)

###   
Setting up a SerpApi account

[SerpApi](https://serpapi.com/) offers a free plan for newly created accounts. Head to the [sign-up](https://serpapi.com/users/sign%5Fup?plan=free) page to register an account and do your first search with our [interactive playground](https://serpapi.com/playground?engine=youtube). When you want to do more searches with us, please visit the [pricing page](https://serpapi.com/pricing).

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2024/01/Screenshot-2024-01-02-at-15.11.27.png)

Once you are familiar with all the results, you can utilize SERP APIs using your [API Key](https://serpapi.com/manage-api-key).

### **Scrape your first YouTube Shorts videos result with SerpApi**

Head to the YouTube search results from [the documentation](https://serpapi.com/youtube-search-api) on[ SerpApi](https://serpapi.com/) for details.

In this tutorial, we will scrape and extract the shorts videos results of "coffee" keyword. The data contains: "id", "title", "link", "thumbnail", "views".

First, you need to install the [SerpApi client library](https://github.com/serpapi/serpapi-python).

```python
pip install google-search-results
```

Set up the[ SerpApi](https://serpapi.com/?ref=serpapi.com)[ credentials](https://serpapi.com/manage-api-key?ref=serpapi.com) and search.

```python
import serpapi, os, json

params = {
    'api_key': 'YOUR_API_KEY',         # your serpapi api
    'engine': 'youtube',               # SerpApi search engine	
    'search_query': 'coffee'
}

```

To retrieve YouTube shorts videos results for a given search term, you can use the following code:

```python
client = serpapi.Client()
shorts_results = client.search(params)['shorts_results']
results = []

for shorts_hash in shorts_results:
    results = results + shorts_hash['shorts']

```

You can store Shorts videos results JSON data in databases or export them to a CSV file.

```python
import csv

header = ['id', 'title', 'link', 'thumbnail', 'views']

with open('youtube_shorts.csv', 'w', encoding='UTF8', newline='') as f:
    writer = csv.writer(f)

    writer.writerow(header)

    for item in results:
        print(item)
        writer.writerow([item.get('video_id'), item.get('title'), item.get('link'), item.get('thumbnail'), item.get('views')])

```

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2024/01/Screenshot-2024-01-02-at-15.26.36.png)

This example is using Python, but you can also use your all your favorite programming languages like Ruby, NodeJS, Java, PHP, and more.

If you have any questions, please feel free to [contact me](mailto:andy@serpapi.com).