C# SDK engine
Google Videos Light
Google Videos Light search using the same typed video result contract.
C# пример
Вызов через XylopSearchClient
using Xylop.Api.Client;
var client = new XylopSearchClient(new HttpClient(), "YOUR_API_KEY");
using var response = await client.SearchJsonAsync(
XylopSearchEngines.GoogleVideosLight,
new Dictionary<string, string?>
{
["q"] = "coffee brewing",
["gl"] = "us",
["hl"] = "en",
["start"] = "0",
["device"] = "desktop",
});
Для типизированного режима используйте `SearchAsync<TResponse>` и response-модель из `Xylop.Logic.SerpApiResponses.*`, которая входит в пакет C# SDK.
Endpoint
HTTP контракт
- URL
https://api.xylop.ru/search- Engine
google_videos_light- API key
- Передается SDK автоматически из настроек клиента.
Входные параметры
Параметры запроса
| Параметр | Тип | Обязателен | Значение | Описание |
|---|---|---|---|---|
api_key
SDK
|
string | Да | — | Ключ Xylop API. В C# SDK задается один раз в XylopSearchClientOptions.ApiKey или в конструкторе клиента. |
engine
SDK
|
string | Да |
google_videos_light
|
Google Videos Light engine. |
q
|
string | Да | coffee brewing | Video search query. |
gl
|
string | Нет |
us
|
Country code. |
hl
|
string | Нет |
en
|
Interface language. |
start
|
number | Нет | 0 | Pagination offset. |
device
|
string | Нет |
desktop
|
desktop, tablet or mobile. |
Выходные параметры
Поля ответа
| Поле | Тип | Источник | Описание |
|---|---|---|---|
search_metadata |
object | пример ответа | Метаданные запроса: статус, идентификатор, время выполнения и служебная информация провайдера. |
search_parameters |
object | пример ответа | Нормализованные параметры, с которыми upstream-поиск выполнил запрос. |
video_results |
array | пример ответа | Видео-результаты: заголовки, каналы, длительность, ссылки и превью. |
JSON
Пример ответа
{
"search_metadata": {
"status": "Success",
"google_videos_light_url": "https://www.google.com/search?tbm=vid&q=coffee+brewing"
},
"search_parameters": {
"engine": "google_videos_light",
"q": "coffee brewing"
},
"video_results": [
{
"position": 1,
"title": "How to brew coffee",
"link": "https://example.com/video",
"duration": "8:21"
}
]
}