是否有官方API或半专业API在Yandex.com上进行搜索?
答案 0 :(得分:8)
官方API - this one,俄文文档(尽管谷歌翻译应该足以满足大多数需求)。 API是基于XML的(带有XML内容的HTTP POST请求,schema available here),因此它与语言无关。
答案 1 :(得分:4)
您也可以使用此python客户端:https://github.com/dbf256/py-ya-xml。
答案 2 :(得分:2)
英文API文档: http://api.yandex.com/xml/doc/dg/concepts/about.xml
首先需要从here
获取API密钥注意:您的每日限额为10 searches only!
答案 3 :(得分:1)
还有一个来自 SerpApi 的 Yandex Search Engine Results API。这是一个免费试用的付费 API。
集成和链接到 replit.com 的示例代码:
import os
from serpapi import GoogleSearch
params = {
"engine": "yandex",
"text": "london",
"lang": "en",
"no_cache": "true",
"api_key": os.getenv("API_KEY"),
}
search = GoogleSearch(params)
results = search.get_dict()
for organic_result in results["organic_results"]:
print(f"Title: {organic_result['title']}\nLink: {organic_result['link']}")
print()
输出:
Title: London - Wikipedia
Link: https://en.wikipedia.org/wiki/London
Title: London.gov.uk - Mayor of London, Sadiq Khan | London...
Link: https://www.london.gov.uk/
Title: Welcome to London - visitlondon.com
Link: https://www.visitlondon.com/
Title: London 2021: Best of London, England Tourism - Tripadvisor
Link: https://www.tripadvisor.com/Tourism-g186338-London_England-Vacations.html
Title: @LONDON • #ThisIsLondon — Instagram
Link: https://www.instagram.com/london/
Title: Visit London - Home | Facebook
Link: https://www.facebook.com/visitlondon
Title: London - BBC News
Link: https://www.bbc.com/news/england/london
Title: London | History, Maps, Points of Interest, & Facts | Britannica
Link: https://www.britannica.com/place/London
Title: THE 10 BEST Things to Do in London - 2021 (with Photos)
Link: https://www.tripadvisor.co.uk/Attractions-g186338-Activities-London_England.html
Title: London | UK news | The Guardian
Link: https://www.theguardian.com/uk/london
Title: 5 отелей в Лондон, США. Большой выбор. Удобный поиск.
Link: http://yabs.yandex.ru/count/WceejI_zO1y21HC0f1z9v4EeJy35TmK07mCGW0WndYHeO0FYsCEGWGA00T-3uTy6Y06XdVUx9P01fAxKk3MO0Q2zmuKxk070djMn5C01NDW1il7v3k01e8wc1UW1i0AW0kYtd8QKWQeE-0Bmwl7WeSQurUK1c0FQloQe0nh01EO2w0Ja4_W4qhmAY0NIl0gG1RkQ4Q05kFm2g0Mu_0Am1RZy0hkQ4SW5WF6k0QW6hW6u1gW1mGQUA1-HBnpCBicqZsUmYANN3HUm1u20c22u1u05q0S2u0Ua3_47RH6Iixl0mso020JG29I2z9jEoQeB4FVzAtEFPm008m7B60s_1G3P2-WBqhmAy0i9Y0pexjw-0QaCPY9laBAJKp_e3AC2u0s3W810dj7yYFc5X-Oke0x0X3tO3WAX3u0Gef-k3P0GZxh1lAI0ujpg-1284G6XqX-oyoWqHZ_m4ly1Y1C2cE0JWF44kvgNiia5w1IC0j0Lq9UooGNO5S6AzkoZZxpyO_2W5j3ec8C6oHRG5kZkthu1WHUO5xMtlWEe5m705xG2s1V0X3sP6A0O0h0Ou9gWWmRG613u69R_cC-Wh-_Kim606P0P0Q0Pg06u6V___m7I6H9vOM9pNtDbSdPbSYzoDJ4qBJFe6O320_0PWC83WHh__pVnYKRUsR0Qgz7XdlMlfSUf0RWQ0Hy0JHjdE9JX9xaqH28VaRjiEEbWgL6nB7kf5A9yk3SgXs-9Y6SXMTNab23mfa6qSQzki2WYx0XV9sdYksPK4-0CaGvk0Ks078R1be9vpa76AoLZVhdKoIF8kz4Z1kLi9b8pZ3i0~1?from=yandex.com%3Bsearch%26%23x2F%3B%3Bweb%3B%3B0%3B&q=london&etext=2202.o67jUO4r92zBdUzYHfgKoHZoaXR6ZHlkbmljcmZueHE.96884cec8a587a7face28868072dfd5a9cded744
<块引用>
免责声明,我为 SerpApi 工作。