Package: yandex-webmaster-api
wrapper for yandex webmaster apiInstallInstall usingpip...pip install yandex-webmaster-apiUsage=======fromyandex_webmasterimportYandexWebmasterclient=YandexWebmaster('<access_token>')get hostsdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts.htmlhosts=client.get_hosts()get popular search queriesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-search-queries-popular.htmlparamsnametypedefault valuehost_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredquery_indicatorstrrequiredorder_byOptional[str]TOTAL_SHOWSdevice_type_indicatorOptional[str]Nonelimitint500offsetint0fromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_popular_search_queries('<host_id>',date_from,date_to,query_indicator='TOTAL_SHOWS')get search query all historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-search-queries-history-all.htmlparamsnametypedefault valuehost_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredquery_indicatorstrrequiredorder_byOptional[str]TOTAL_SHOWSdevice_type_indicatorOptional[str]Nonefromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_search_query_all_history('<host_id>',date_from,date_to,query_indicator='TOTAL_SHOWS',device_type_indicator='DESKTOP')get single search query historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-search-queries-history.htmlparamsnametypedefault valuehost_idstrrequiredquery_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredquery_indicatorstrrequireddevice_type_indicatorOptional[str]Nonefromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_single_search_query_history('<host_id>','<query_id>',date_from,date_to,query_indicator='TOTAL_SHOWS',device_type_indicator='DESKTOP')get list query analyticsdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-query-analytics.htmlparamsnametypedefault valuehost_idstrrequireddevice_type_indicatorstr"ALL"text_indicatorstr"URL"limitint20offsetint0region_idsOptional[list]NonefiltersOptional[dict]Nonesort_by_dateOptional[dict]Noneresult=client.get_list_query_analytics('<host_id>',"ALL",limit=500,offset=500)get host infodoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-id.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_host('<host_id>')get sqi historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/sqi-history.htmlparamsnametypedefault valuehost_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredfromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_sqi_history('<host_id>','<query_id>',date_from,date_to)add hostdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-add-site.htmlparamsnametypedefault valuehost_urlstrrequiredresult=client.add_host(host_url='<host_url>')delete hostdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-delete.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.delete_host(host_id='<host_id>')get sitemapsdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-sitemaps-get.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_sitemaps(host_id='<host_id>')get_sitemapdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-sitemaps-get.htmlparamsnametypedefault valuehost_idstrrequiredsitemap_idstrrequiredresult=client.get_sitemap(host_id='<host_id>',sitemap_id='<sitemap_id>')add sitemapdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-user-added-sitemaps-post.htmlparamsnametypedefault valuehost_idstrrequiredhost_urlstrrequiredresult=client.add_sitemap(host_id='<host_id>',host_url='<host_url>')delete sitemapdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-user-added-sitemaps-post.htmlparamsnametypedefault valuehost_idstrrequiredsitemap_idstrrequiredresult=client.delete_sitemap(host_id='<host_id>',sitemap_id='<sitemap_id>')get indexing statsdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-id-summary.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_indexing_stats(host_id='<host_id>')get indexing historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-id-summary.htmlparamsnametypedefault valuehost_idstrrequireddate_fromstrrequireddate_tostrrequiredfromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_indexing_history(host_id='<host_id>',date_from=date_from,date_to=date_to)get indexing samplesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-indexing-samples.htmlparamsnametypedefault valuehost_idstrrequiredlimitint100offestint0result=client.get_indexing_samples(host_id='<host_id>')get monitoring important urlsdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-id-important-urls.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_monitoring_important_urls(host_id='<host_id>')get important url historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-id-important-urls.htmlparamsnametypedefault valuehost_idstrrequiredurlstrrequiredresult=client.get_important_url_history(host_id='<host_id>',url='<url>')get insearch url historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-indexing-insearch-history.htmlparamsnametypedefault valuehost_idstrrequireddate_fromstrrequireddate_tostrrequiredfromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_important_url_history(host_id='<host_id>',date_from=date_from,date_to=date_to)get insearch url samplesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-indexing-insearch-history.htmlparamsnametypedefault valuehost_idstrrequiredlimitint100offestint0result=client.get_insearch_url_samples(host_id='<host_id>',limit=limit,offset=offset)get insearch url events historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-search-events-history.htmlparamsnametypedefault valuehost_idstrrequireddate_fromstrrequireddate_tostrrequiredfromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_insearch_url_events_history(host_id='<host_id>',date_from=date_from,date_to=date_to)get insearch url events samplesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/hosts-search-events-samples.htmlparamsnametypedefault valuehost_idstrrequiredlimitint100offestint0result=client.get_insearch_url_events_samples(host_id='<host_id>',limit=limit,offset=offset)recrawl urldoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-recrawl-post.htmlparamsnametypedefault valuehost_idstrrequiredurlstrrequiredresult=client.recrawl_url(host_id='<host_id>',url='<recrawl_url>')get recrawl taskdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-recrawl-task-get.htmlparamsnametypedefault valuehost_idstrrequiredtask_idstrrequiredresult=client.get_recrawl_task(host_id='<host_id>',task_id='<task_id>')get recrawl tasksdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-recrawl-get.htmlparamsnametypedefault valuehost_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredlimitint100offsetint0fromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_recrawl_tasks(host_id='<host_id>',date_from=date_from,date_to=date_to,limit=10,offset=10)get recrawl quotadoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-recrawl-quota-get.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_recrawl_quota(host_id='<host_id>')diagnostic sitedoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-diagnostics-get.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.diagnostic_site(host_id='<host_id>')get broken internal links samplesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-diagnostics-get.htmlparamsnametypedefault valuehost_idstrrequiredindicatorstrrequiredlimitint100offsetint0result=client.get_broken_internal_links_samples(host_id='<host_id>',indicator='SITE_ERROR')get broken internal links historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-links-internal-history.htmlparamsnametypedefault valuehost_idstrrequireddate_fromdatetimerequireddate_todatetimerequiredfromdatetimeimportdatetime,timedeltadate_from=datetime.now()-timedelta(days=4)date_to=datetime.now()result=client.get_broken_internal_links_samples(host_id='<host_id>',date_from=date_from,date_to=date_to)get external links samplesdoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-links-external-samples.htmlparamsnametypedefault valuehost_idstrrequiredlimitint100offsetint0result=client.get_external_links_samples(host_id='<host_id>')get external links historydoc -https://yandex.ru/dev/webmaster/doc/dg/reference/host-links-external-history.htmlparamsnametypedefault valuehost_idstrrequiredresult=client.get_external_links_history(host_id='<host_id>')CHANGELOG0.0.2 - add get_list_query_analytics method