Skip to main content

AI-agent friendly CLI for Yandex Search API — web search and YandexGPT generative search from the terminal.

Project description

ru

yandex-search-cli

CLI for Yandex Search API and YandexGPT — web search and generative AI search from your terminal.

PyPI Python 3.11+ License: MIT Stars


What it does

yandex-search-cli wraps the Yandex Search API in two terminal commands. It is the practical way to query Yandex — the dominant search engine for Russian-language content — from scripts, pipelines, and AI agent workflows.

yandex-search performs web search and returns structured results: title, URL, domain, publication date, and text passages. yandex-gen uses YandexGPT to answer a question and cite the sources it used.

Both commands output clean --json for use in scripts and AI agents.

Who it is for

  • Developers building automation pipelines over Russian-language web content
  • AI agent developers who need structured search output from Yandex
  • Researchers working with Russian-language sources, .ru domains, or Yandex Cloud
  • Anyone using Claude Code, Codex, Cursor, or Windsurf who needs Yandex access from the terminal

Features

  • Web search via Yandex with domain, date, and passage metadata
  • Generative search via YandexGPT — answers with cited sources
  • Filter results by domain (--site)
  • Search .ru, .com, and regional Yandex indexes
  • Paginate results (--page)
  • Filter by region code
  • Clean --json output for every command

Installation

uv tool install yandex-search-cli

No uv? Run curl -LsSf https://astral.sh/uv/install.sh | sh, or use pip install yandex-search-cli.

Quick start

You need a Yandex Cloud account with Search API enabled (quickstart):

mkdir -p ~/.search-api
echo '{"apiKey": "your-key", "folderId": "your-folder-id"}' > ~/.search-api/config.json
yandex-search "smart city digital platform"

Or via env vars: export YANDEX_API_KEY=... && export YANDEX_FOLDER_ID=...

Usage

# Web search
yandex-search "smart city digital platform monograph"

# Restrict to a domain
yandex-search "async python" --site habr.com

# Search the .com Yandex index, more results
yandex-search "machine learning" -t com -n 20

# Generative answer with cited sources
yandex-gen "explain the difference between monolith and microservices"

# Restrict generative search to a domain
yandex-gen "how to configure nginx" --site nginx.org

# JSON — extract all URLs
yandex-search "topic" --json | jq -r '.[].url'

# JSON — filter results by domain pattern
yandex-search "regulations" --json \
  | jq '[.[] | select(.domain | test("gov\\.ru"))]'

All flags — yandex-search:

Flag Default Description
-n / --num-results 10 Number of results
-t / --type ru Search index: ru · com · tr · kk · be · uz
-r / --region Region code (e.g. 213 for Moscow)
-p / --page 0 Page number, zero-indexed
--site Restrict results to this domain
--json off JSON array: [{title, url, domain, date, passages}]

All flags — yandex-gen: --site, --json

AI agent usage

yandex-search-cli is stateless, read-only, and designed to be called by AI coding assistants (Claude Code, Codex, Cursor, Windsurf, etc.).

# Search and extract URLs
yandex-search "topic" --json | jq -r '.[].url'

# Collect results across multiple pages
for page in 0 1 2; do
  yandex-search "query" -p $page --json
done | jq -s 'add'

# Generative answer as JSON
yandex-gen "question" --json | jq '.message.content'

JSON schema for yandex-search --json:

[
  {
    "title": "Page title",
    "url": "https://example.ru/page",
    "domain": "example.ru",
    "date": "2024-03-15",
    "passages": ["Relevant text snippet..."]
  }
]

See AGENTS.md for full schemas, exit codes, and environment reference.

Full documentation

Project metadata

  • Author: Nolan Vale
  • Brand: Nolan Vale Tools
  • Focus: search automation, Yandex Search, AI-agent tooling, Russian web workflows, developer productivity
  • License: MIT

Built by Nolan Vale
Part of Nolan Vale Tools — practical open-source utilities for search, automation, AI agents, and developer workflows.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yandex_search_cli-0.1.4.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yandex_search_cli-0.1.4-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file yandex_search_cli-0.1.4.tar.gz.

File metadata

  • Download URL: yandex_search_cli-0.1.4.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yandex_search_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5c0ebd2ee53a372257b48fa0ef51ab65d84b6c0a50e740d62c6a6115cb31fec3
MD5 4283ffb0f0ec59fd170ad13f02504f2b
BLAKE2b-256 a350e9e57b6116ca490a23140361c274f5659264d49a31a3f02db60276712067

See more details on using hashes here.

File details

Details for the file yandex_search_cli-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: yandex_search_cli-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for yandex_search_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e86ad8448cc1112d55f34f466150f6a9de379e06483bbd4d81970402604a149c
MD5 3f559e7809a30000b643290f63d47b4e
BLAKE2b-256 26e3741c7255c00da0f5f134667d1ea8247bc83b8174857a8e7d4b3347f932e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page