# FlashData Google Videos API

Tìm video trên các trang web với Google. Lấy tiêu đề, liên kết video, mẫu ảnh, thời gian và thông tin nguồn.

Tài liệu tham khảo chính điển: https://flashdata.dev/vi/docs/sources/google_videos
Xem lại: 2026-10-23

Điểm kết thúc: POST https://data.flashdata.dev/v1/queries/realtime
Xác thực: X-API-Key: YOUR_API_KEY
Chế độ: [Realtime](https://flashdata.dev/vi/docs/reference/realtime-and-async/reference.md#realtime) · [Async](https://flashdata.dev/vi/docs/reference/realtime-and-async/reference.md#async) · [Batch](https://flashdata.dev/vi/docs/reference/batch-and-bulk/reference.md#batch)

Cần thiết quyền truy cập nguồn: google_videos

Thay thế YOUR_API_KEY với một API Chìa khóa mà có quyền sử dụng nguồn này và tín dụng sẵn có. Chạy yêu cầu trên máy chủ hay máy phục vụ.

[Đang thiết lập xác thực](https://flashdata.dev/vi/docs/guides/headers-and-authentication/reference.md)

[Chọn và tinh luyện một tìm kiếm Google](https://flashdata.dev/vi/docs/guides/google-search-guide/reference.md)

<a id="quickstart"></a>

## Gửi một yêu cầu

### Python

```bash
python3 -m pip install requests
```

```python
import json

import requests

api_key = "YOUR_API_KEY"
payload = {
    "source": "google_videos",
    "query": "me at the zoo",
    "params": {
        "gl": "us",
        "hl": "en",
        "num": 10,
        "page": 1,
    },
}

response = requests.post(
    "https://data.flashdata.dev/v1/queries/realtime",
    headers={"X-API-Key": api_key},
    json=payload,
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), ensure_ascii=False, indent=2))
```

### Bash / cURL

```bash
api_key="YOUR_API_KEY"
curl --fail-with-body --max-time 120 --request POST "https://data.flashdata.dev/v1/queries/realtime" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $api_key" \
  --data-binary @- <<'FLASHDATA_JSON'
{
  "source": "google_videos",
  "query": "me at the zoo",
  "params": {
    "gl": "us",
    "hl": "en",
    "num": 10,
    "page": 1
  }
}
FLASHDATA_JSON
```

<a id="parameters"></a>

## Tham số

<a id="parameters-group-0"></a>

### Nội dung yêu cầu

| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- |
| <a id="parameter-source"></a> source | string | Vâng | — | Thiết lập google_videos.  |
| <a id="parameter-query"></a> query | string | Vâng | Chưa đặt | Truy vấn tìm kiếm. Hỗ trợ Google tìm kiếm các nhà điều hành như trang web: và trong danh sách: Chiều dài tối thiểu: 1. Chiều dài tối đa: 2000. |
| <a id="parameter-params"></a> params | object | Không | {} | Settings cho yêu cầu này.  |
| <a id="parameter-callback_url"></a> callback_url | string · nullable | Không | Chưa đặt | Async và chỉ một mẻ. Chung HTTPS hoàn tất URL trên cổng 443Đến 2,048 các nhân vật. Không có phân khúc người dùng hay URL. Omit, dùng null hoặc chuỗi rỗng không cho thông báo nào. Trong một mẻ, đặt nó trên mỗi câu hỏi, bên ngoài các tham số.  |

<a id="parameters-group-1"></a>

### Quốc gia, địa điểm và ngôn ngữ

| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-gl"></a> params.gl | string | Không | Chưa đặt | Mã quốc gia 2 chữ cái, như chúng ta, gb, de hoặc sg. Đặt dứt khoát để chọn một nước. Chiều dài tối thiểu: 2. Chiều dài tối đa: 2. Mẫu: ^[A-Za-z]{2}$ |
| <a id="parameter-params-hl"></a> params.hl | string | Không | Chưa đặt | Google Ngôn ngữ giao diện. Đặt một cách rõ ràng để chọn một ngôn ngữ. Chiều dài tối thiểu: 1. Chiều dài tối đa: 35. Mẫu: ^[A-Za-z0-9-]+$ |
| <a id="parameter-params-location"></a> params.location | string | Không | Chưa đặt | Đã yêu cầu địa điểm tìm kiếm, tốt hơn là một thành phố, như "London, England, United Kingdom". Tính khả thi phụ thuộc vào kiểu tìm kiếm. Chiều dài tối thiểu: 1. Chiều dài tối đa: 200. |

<a id="parameters-group-2"></a>

### Đăng ký

| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-num"></a> params.num | integer | Không | Chưa đặt | Yêu cầu số lượng kết quả. FlashData không thêm giá trị mặc định cố định khi bỏ qua. Số đếm lại có thể khác nhau khi truy vấn và tìm kiếm kiểu. Tối thiểu: 1. Tối đa: 100. |
| <a id="parameter-params-page"></a> params.page | integer | Không | Chưa đặt | Đã yêu cầu trang kết quả. Chuẩn bị rõ ràng. Mỗi trang là một yêu cầu khác nhau của API. Tối thiểu: 1. Tối đa: 100. |

<a id="parameters-group-3"></a>

### Bộ lọc tìm kiếm

| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-tbs"></a> params.tbs | string | Không | Chưa đặt | Đã yêu cầu Google lọc tìm kiếm, như qdr:d cho ngày qua hoặc qdr:w cho tuần vừa qua. Tính khả thi phụ thuộc vào kiểu tìm kiếm. Chiều dài tối thiểu: 1. Chiều dài tối đa: 200. |
| <a id="parameter-params-autocorrect"></a> params.autocorrect | boolean | Không | Chưa đặt | Yêu cầu sửa chính tả bằng true hoặc yêu cầu nó bị tắt false. Ứng xử ứng dụng phụ thuộc vào kiểu tìm kiếm; bỏ qua cần dùng GoogleHành vi.  |

<a id="response"></a>

## Đọc kết quả

Cứu người thành công JSON trả lời response.json. Lưu cái này vào read-response.py và chạy python read-response.py. Nó chỉ dùng thôi. PythonThư viện thông thường và không có yêu cầu mới.

### read-response.py

```python
import json
from pathlib import Path

response = json.loads(Path("response.json").read_text(encoding="utf-8-sig"))
if response.get("status") not in ("done", "completed") or not isinstance(response.get("results"), list):
    raise SystemExit("Expected completed result JSON; inspect the response or job status.")
if not response["results"]:
    print("[]")
    raise SystemExit(0)
result = response["results"][0]

output = [
    {"title": item.get("title"), "url": item.get("link"), "duration": item.get("duration")}
    for item in result.get("videos", [])
]
print(json.dumps(output, ensure_ascii=False, indent=2))
```

## Phản hồi mẫu

Ví dụ được thu; trường và số phụ thuộc vào nguồn và yêu cầu nhập.
```json
{
  "source": "google_videos",
  "status": "done",
  "results": [
    {
      "searchParameters": {
        "q": "me at the zoo",
        "gl": "us",
        "hl": "en",
        "type": "videos",
        "num": 10,
        "page": 1,
        "engine": "google"
      },
      "videos": [
        {
          "title": "Me at the zoo",
          "link": "https://www.youtube.com/watch?v=jNQXAC9IVRw&vl=en",
          "snippet": "Microplastics are accumulating in human brains at an alarming rate https://www.youtube.com/watch?v=0PT5c1z3LL8 “Nanoplastics and Human ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNoybJBMfqr7vwH-saySvflZreMzBKZDBjW_zQMrY81E-xQZBBMzVuRw&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcS8uZHJMduuLjzsxqOtyhx8VWeRlui2Fo0sUg",
          "duration": "0:19",
          "source": "YouTube",
          "channel": "jawed",
          "date": "Apr 23, 2005",
          "position": 1
        },
        {
          "title": "Me at the zoo - 20 Years Later",
          "link": "https://www.youtube.com/watch?v=ydEMNzksm2M",
          "snippet": "A FAN RECREATION. same location. same outfit kinda sorta. different guy. 20 years later @jawed New video: https://youtu.be/vRgvdCkzvws How ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8mNQG1XbHxQwXcM0_B0L3wpgVPSmORnijKhh5knB2aRxvmApdoyigXw&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcR1ZyuOVJiBgaK96Ew85Bx19aYKLXddf-dcDQ",
          "duration": "0:45",
          "source": "YouTube",
          "channel": "Cody Hales",
          "date": "Apr 23, 2025",
          "position": 2
        },
        {
          "title": "Me at the zoo",
          "link": "https://youtube.com/watch?v=jNQXAC9IVRw&si=EnSIkaIECMiOmarE",
          "snippet": "Microplastics are accumulating in human brains at an alarming rate https://www.youtube.com/watch?v=0PT5c1z3LL8 “Nanoplastics and Human ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNoybJBMfqr7vwH-saySvflZreMzBKZDBjW_zQMrY81E-xQZBBMzVuRw&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcS8uZHJMduuLjzsxqOtyhx8VWeRlui2Fo0sUg",
          "duration": "0:19",
          "source": "YouTube",
          "channel": "jawed",
          "date": "Apr 23, 2005",
          "position": 3
        },
        {
          "title": "Me at the Zoo 21 Years Later",
          "link": "https://www.youtube.com/watch?v=NiIqMwDDPQQ",
          "snippet": "YouTube's First Video: Me at the zoo by Jawed Karim in 2005 A Look back some history of Youtube's creation and what happened to the ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSELgaIiAXmIin2tym4YpTtUt3a9LT66r3qpMkg3Cm2erBOcUc_cOzfxQ&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcRSNKT2ukHk51PE2iHMpOXn0Fk-NYYzcjdtzg",
          "duration": "2:37",
          "source": "YouTube",
          "channel": "AcidGlow",
          "date": "Apr 26, 2026",
          "position": 4
        },
        {
          "title": "Me at the Zoo | 20 years of YouTube",
          "link": "https://www.youtube.com/watch?v=SKcXEYqsX1M",
          "snippet": "20 years ago, the first video was uploaded to YouTube, by Jawed. This is my remake of that first video uploaded to YouTube back on 23rd ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYk6-MZVYhxJohW4sXDVRGWjqp796KjEJgWqKeZtfQAhCtMkyiVfVVjQ&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcSPcbOknGe09bBsfDEZ8OJXxOnYAFxeiMzRIg",
          "duration": "1:40",
          "source": "YouTube",
          "channel": "Alice Goss Travel",
          "date": "Apr 22, 2025",
          "position": 5
        },
        {
          "title": "happy 20th birthday YouTube! on this day, 2005, the first ever ...",
          "link": "https://www.facebook.com/lestwinsforsmartpeople/videos/happy-20th-birthday-youtube-on-this-day-2005-the-first-ever-video-was-uploaded-t/1174885864134048/",
          "snippet": "❤ on this day, 2005, the first ever video was uploaded to YouTube: \"Me at the Zoo\" by Jawed Karim, one of the founders of YouTube. I opened my ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQXK7QFFc7Ve5rxWu28XVD7PwN4wMGxFwBGODfb0inSiJkJXkLfspNBBQ&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcQwaWPOAa18cvUeFQmJ83tHI75KwkZZXhcz1g",
          "duration": "0:20",
          "source": "Facebook",
          "channel": "Les Twins for smart people",
          "date": "Apr 23, 2025",
          "position": 6
        },
        {
          "title": "23rd April 2005: The first video uploaded to YouTube is \"Me at ...",
          "link": "https://www.youtube.com/watch?v=nW0JMJUW394&vl=en",
          "snippet": "... Me at the zoo” shows Karim speaking in front of the elephant enclosure at the San Diego Zoo in San Diego, California. The video lasts ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKL5tOeVLTkPnKgGJ-irZeBKXegrS3jv3aOmqfPRvnDnFDH0wlm6KTsQ&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcT32pM4ScwLqW8pW44XEj6g02KCXVGZZU12oA",
          "duration": "2:30",
          "source": "YouTube",
          "channel": "HistoryPod",
          "date": "Apr 22, 2026",
          "position": 7
        },
        {
          "title": "Me at the zoo",
          "link": "https://www.youtube.com/shorts/bXz16dux7j0",
          "snippet": "Maybe it's time to go back to the zoo?",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTKNATyMcisc3lfWovvV89H6Pgk2EMqkA4wPBgN3hwB2D9r4c0vzj9qog&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcRo2eKznhm-_ijvAmb_52BgREvjyQVWcJ5arQ",
          "duration": "0:17",
          "source": "YouTube",
          "channel": "Timeworks",
          "date": "Apr 23, 2025",
          "position": 8
        },
        {
          "title": "Me At The Zoo",
          "link": "https://www.youtube.com/watch?v=SfSsDBEs1yc",
          "snippet": "Me At The Zoo • 20th Anniversary (24/04/2025) a huge shoutout to 'Me at the zoo' today as it becomes the first video on @YouTube to be 20 ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ6BBRlx150FgR3w89enIZwuSIm7gumK0O-yC7GqO_KF0zr8ZIGuNANHA&s",
          "videoUrl": "https://encrypted-vtbn0.gstatic.com/video?q=tbn:ANd9GcSG5JQlJ3MiAYkmoTPoE-KLNrrS6rkWyAkJWw",
          "duration": "0:26",
          "source": "YouTube",
          "channel": "MrHaydnSir",
          "date": "Apr 24, 2025",
          "position": 9
        },
        {
          "title": "The first ever YouTube video, \"Me at the zoo\", turns 21 years ...",
          "link": "https://www.reddit.com/r/interesting/comments/1su0btj/the_first_ever_youtube_video_me_at_the_zoo_turns/",
          "snippet": "The first ever YouTube video, \"Me at the zoo\", turns 21 years old today. ... This video cannot be played. 0:00 0: ...",
          "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2us_fh54LqB7h_F3viDdnV4PCbByjapkYj5JO8I6SoErU3NPFrY5tYw&s",
          "duration": "0:18",
          "source": "Reddit",
          "channel": "Deleted User",
          "date": "Apr 24, 2026",
          "position": 10
        }
      ]
    }
  ],
  "usage": {
    "credits": 0.02
  },
  "created_at": "2026-09-16T07:41:45.419Z"
}
```

## Trường đáp ứng

| Tìm kiếm | Kiểu | Mô tả |
| --- | --- | --- |
| source | string | Nguồn API đã yêu cầu. |
| status | string | hoàn thành khi yêu cầu thời gian thực thành công. |
| created_at | string | Thời gian tạo ra đáp ứng trong ISO 8601 Định dạng. |
| usage.credits | number | Các nguồn tin cho yêu cầu, dựa trên kế hoạch của anh. |
| results[0].searchParameters | object | Thiết lập tìm kiếm được báo cáo bởi GoogleVới yêu cầu được ghi lại là Q. Thiết lập trở lại có thể khác với các giá trị đã yêu cầu. |
| results[0].videos | array | Kết quả tìm kiếm phim Google. |
| results[0].videos[].title | string | Tiêu đề video. |
| results[0].videos[].link | string | Video trang URL. |
| results[0].videos[].snippet | string · optional | Đoạn phim mô tả. |
| results[0].videos[].duration | string · optional | Định dạng đoạn phim. |
| results[0].videos[].source | string · optional | Trang web chủ. |
| results[0].videos[].channel | string · optional | Người xuất bản hay tên kênh. |
| results[0].videos[].date | string · optional | Ngày xuất bản như được hiển thị bởi Google. |
| results[0].videos[].imageUrl | string · optional | Hình thu nhỏ URL. |
| results[0].videos[].position | integer | Vị trí kết quả. |
| results[0].videos[].videoUrl | string · optional | Ảnh động URL báo cáo bởi Google khi nào rảnh. |

- Các trường sẵn sàng phụ thuộc vào yêu cầu và kiểu tìm kiếm. Những cánh đồng tùy chọn có thể bị vắng mặt, và có thể trở lại những cánh đồng khác.
- Số mục đã trả lại và searchParameters.num có thể khác params.num. Dùng dãy số điện thoại trả lại để xác định kết quả thực tế.

## Định dạng phản hồi

Đáp ứng được dùng JSON theo mặc định. Chọn một định dạng khác với những đầu trang tùy chọn này.

- Accept: application/json (mặc định) hay text/plain. Văn bản thường trình bày cùng một lĩnh vực trong một bố trí có thể đọc được, được in lề.
- X-Respond-With: markdown. Hãy để lại chỗ trống cho những cánh đồng nguyên thủy. Markdown hoạt động với định dạng trả lời.

Markdown có sẵn cho các yêu cầu thời gian thực và kết quả hoàn tất.

Các trường bên dưới mô tả giá trị mặc định JSON Trả lời đi.

[Ví dụ định dạng đáp ứng yêu cầu](https://flashdata.dev/vi/docs/guides/response-formats/reference.md#headers)

<a id="job-lifecycle"></a>

<a id="async-batch"></a>

## Kiến thức cơ bản về API

Các yêu cầu xây dựng và ví dụ trên sử dụng các tham số của nguồn này. Sử dụng Python và cURL Những ví dụ bên dưới để được chia sẻ sự phục tùng, địa vị và kết quả là bước. A Batch Cơ thể là một JSON Đối tượng chứa các đồ thị; mỗi món đồ trả lại công việc của chính mình ID.

- [Async yêu cầu và biên lai](https://flashdata.dev/vi/docs/reference/realtime-and-async/reference.md#async)

<a id="job-status"></a>

- [Kiểm tra tình trạng công việc](https://flashdata.dev/vi/docs/reference/realtime-and-async/reference.md#status)

<a id="job-results"></a>

- [Lấy kết quả hoàn tất](https://flashdata.dev/vi/docs/reference/realtime-and-async/reference.md#results)
- [Batch JSON yêu cầu](https://flashdata.dev/vi/docs/reference/batch-and-bulk/reference.md#batch)
- [Trình khách OpenAPI](https://flashdata.dev/docs/openapi.json)

<a id="webhooks"></a>

<a id="callbacks"></a>

## Thông báo đầy đủ

- [Nhận và kiểm tra hoàn tất kết nối web](https://flashdata.dev/vi/docs/guides/async-batch/reference.md#webhooks)

<a id="troubleshooting"></a>

## Khắc phục sự cố

- [Lỗi và mã trạng thái](https://flashdata.dev/vi/docs/errors/reference.md#status-codes)
- [Khi nào cần thử lại](https://flashdata.dev/vi/docs/errors/reference.md#retries)

## API liên quan

- [YouTube Search API](https://flashdata.dev/vi/docs/sources/youtube_search/reference.md)
- [Google Search API](https://flashdata.dev/vi/docs/sources/google_search/reference.md)
