# Google Shorts API

You have to send a GET request to **`http://api.scrapingdog.com/google_shorts`** with the below-given parameters.

Google Shorts API pricing is available [here](https://www.scrapingdog.com/google-search-api).

### Parameters

#### Scrapingdog Parameters

| Parameter                                                          | Description                                                                                                                                                                |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>api\_key<br></p><p><mark style="color:red;">required</mark></p> | <p>Your personal API key. Available on your dashboard <br><br>Type: <em><strong>String</strong></em></p>                                                                   |
| html                                                               | <p>This will return the full HTML of the Google page. <br><br>Default Value - <strong><code>false</code></strong> <br><br>Type - <strong><code>Boolean</code></strong></p> |

#### Search Query

| Parameter                                                       | Description                                                                                 |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| <p>query</p><p><br><mark style="color:red;">required</mark></p> | <p>This is a Google query. <br><br>Example1 - <strong><code>query=shoes</code></strong></p> |

#### Geographic Location and Localization

| Parameter | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| domain    | <p>To obtain local results from a specific country, for example, for India, it will be "google.co.in," and for the UK, it will be "google.co.uk". For a complete list of supported domains, visit the <a href="https://docs.scrapingdog.com/google-search-scraper-api/google-domains-page">Google domains page</a>.<br></p><p>Default: <code>"google.com"</code></p><p><br>Type: <em><strong>String</strong></em></p>                                                                               |
| country   | <p>This parameter specifies the country for the Google search using a two-letter country code (e.g., US for the United States, UK for the United Kingdom, or FR for France). For a complete list of supported countries, visit the <a href="https://docs.scrapingdog.com/google-search-scraper-api/google-country-parameter-supported-google-countries">Google countries page</a>.</p><p><br>Default Value - <strong><code>us</code></strong></p><p><br>Type - <em><strong>String</strong></em></p> |
| uule      | <p>It is a parameter that specifies the geographic location or locale for which the search results should be tailored. Possible Value could be <strong><code>w+CAIQIFJlbGF5IFN0YXRlcw==</code></strong></p><p><br>Type - <em><strong>String</strong></em></p>                                                                                                                                                                                                                                       |
| language  | <p>Language of the results. Possible Values - <strong><code>en</code></strong>, <strong><code>es</code></strong>, <strong><code>fr</code></strong>, <strong><code>de</code></strong>, etc. Visit <a href="https://docs.scrapingdog.com/google-search-scraper-api/google-language-page">Google's languages page</a> for a complete list of supported countries.</p><p><br>Default Value - en</p><p><br>Type - <em><strong>String</strong></em></p>                                                   |
| lr        | <p>Limit the search to one or multiple languages. It is used as <code>lang\_{language code}</code><em>.</em> Visit <a href="https://docs.scrapingdog.com/google-search-scraper-api/google-lr-language-page">Google's lr languages page</a> for a complete list of supported countries.</p><p><br>Type - <em><strong>String</strong></em></p>                                                                                                                                                        |

#### Advanced Filters

| Parameter | Description                                                                                                                                                                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tbs       | <p>to be searched - An advanced parameter to filter search results. <br><br>Type: <em><strong>String</strong></em></p>                                                                                                                                      |
| safe      | <p>To filter the adult content set <code>safe</code> to <code>active</code> or to disable it set <code>off</code>. <br><br>Type: String <code>\[active/off]</code></p><p><br>Default: <code>off</code></p>                                                  |
| nfpr      | <p>It excludes the result from an auto-corrected query that is spelled wrong. It can be set to <code>1</code> to exclude these results or <code>0</code> to include them. </p><p></p><p>Type: <code>Boolean</code></p><p></p><p>Default: <code>0</code></p> |

#### Pagination

| Parameter | Description                                                                                                                                                                                                            |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start     | <p>This parameter is used for skipping a particular number of results. <br><br>For example - <code>start=12</code> will skip the first 12 results, <code>start=24</code> will skip the first 24 results and so on.</p> |

### API Example

{% tabs %}
{% tab title="cURL" %}

```json
curl "https://api.scrapingdog.com/google_shorts/?api_key=5eaa61a6e562fc52fe763tr516e4653&query=football&country=us"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

api_key = "5eaa61a6e562fc52fe763tr516e4653"
url = "https://api.scrapingdog.com/google_shorts"

params = {
    "api_key": api_key,
    "query": "football",
    "country": "us"
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Request failed with status code: {response.status_code}")

```

{% endtab %}

{% tab title="Node JS" %}

```javascript
const axios = require('axios');

const api_key = '5eaa61a6e562fc52fe763tr516e4653';
const url = 'https://api.scrapingdog.com/google_shorts';

const params = {
  api_key: api_key,
  query: 'football',
  country: 'us'
};

axios
  .get(url, { params: params })
  .then(function (response) {
    if (response.status === 200) {
      const data = response.data;
      console.log(data)
    } else {
      console.log('Request failed with status code: ' + response.status);
    }
  })
  .catch(function (error) {
    console.error('Error making the request: ' + error.message);
  });

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

// Set the API key and request parameters
$api_key = '5eaa61a6e562fc52fe763tr516e4653';
$query = 'football';
$country = 'us';

// Set the API endpoint
$url = 'https://api.scrapingdog.com/google_shorts/?api_key=' . $api_key . '&query=' . $query . '&country=' . $country;

// Initialize cURL session
$ch = curl_init($url);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check if the request was successful
if ($response === false) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    // Process the response data as needed
    echo $response;
}

// Close the cURL session
curl_close($ch);

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'uri'

# Set the API key and request parameters
api_key = '5eaa61a6e562fc52fe763tr516e4653'
query = 'football'
country = 'us'

# Construct the API endpoint URL
url = URI.parse("https://api.scrapingdog.com/google_shorts/?api_key=#{api_key}&query=#{query}&country=#{country}")

# Create an HTTP GET request
request = Net::HTTP::Get.new(url)

# Create an HTTP client
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true # Enable SSL (https)

# Send the request and get the response
response = http.request(request)

# Check if the request was successful
if response.is_a?(Net::HTTPSuccess)
  puts response.body # Process the response data as needed
else
  puts "HTTP request failed with code: #{response.code}, message: #{response.message}"
end

```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try {
            // Set the API key and request parameters
            String apiKey = "5eaa61a6e562fc52fe763tr516e4653";
            String query = "football";
            String country = "us";

            // Construct the API endpoint URL
            String apiUrl = "https://api.scrapingdog.com/google_shorts/?api_key=" + apiKey
                    + "&query=" + query
                    + "&country=" + country

            // Create a URL object from the API URL string
            URL url = new URL(apiUrl);

            // Open a connection to the URL
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            // Set the request method to GET
            connection.setRequestMethod("GET");

            // Get the response code
            int responseCode = connection.getResponseCode();

            if (responseCode == 200) {
                // Read the response from the connection
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder response = new StringBuilder();

                while ((inputLine = reader.readLine()) != null) {
                    response.append(inputLine);
                }
                reader.close();

                // Process the response data as needed
                System.out.println(response.toString());
            } else {
                System.out.println("HTTP request failed with response code: " + responseCode);
            }

            // Close the connection
            connection.disconnect();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Response

```json
{
    "short_videos_results": [
        {
            "title": "Our 2025 record will be ______ #Washington #Commanders ...",
            "source": "YouTube",
            "source_logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR4AWP4//8/RZh6BgCZAkDsAMUNWDFCXgDFACCV8J/B+D8pGKwHRAKRAUyQDEMMQAYEUGBAAsiABpwKHjz4/9/BAZ8BDXgNgIMNGyg04MABkg1AeCEgAK8XKA5EiqORooSELykXEJuUBz43AgAIA1ZhBoG9vwAAAABJRU5ErkJggg==",
            "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYebecEz54tjPFKszjsetcI3L8yOjhK9Q3SzpISgEzICp0hKEk1yLjmqZFolETRQVLxywaTSiRZneC&s=10",
            "gif_url": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcRLUuBp__DXx_QPbH-FUmu9BBB19xpTnpjMNw",
            "account_name": "Washington Commanders",
            "date": "May 15, 2025"
        },
     .....
}
```
