SDK ReferencePython SDK

Search

API functions for the Search resource.

For AI agents: https://bytekit.com/llms.txt — every docs page is available as markdown by appending .md

Search

Functions for interacting with the search API resource. Each operation ships in four forms — sync / sync_detailed and their async counterparts.

Search the web

Runs a web search for query and returns ranked organic results with contiguous position values from 1.

Use limit (1–100, default 10) to request more results in a single call. Results are fetched in pages of 10, so a call consumes ceil(limit / 10) credits (capped at 10) from the account's monthly credits bucket — for example limit=10 costs 1 credit and limit=35 costs 4. Credits are charged for every page fetched regardless of how many results a page returns. The credit count is reported as credits_used in the response.

Parameters

  • body (CreateSearchBody)
  • query — str — The search query, up to 2048 characters.
  • type_ — CreateSearchBodyType | Unset — Which search index to query. web (default) returns ranked organic results; news returns news articles in the same results array, additionally populating source and image on each item; images returns image results, populating source, domain, and a fuller image object (full- image dimensions plus a thumbnail URL and dimensions) while omitting snippet and date. Billing is identical for all three.
  • limit — int | Unset — Maximum number of organic results to return. Results are fetched in pages of 10, so the call costs ceil(limit / 10) credits (capped at 10).
  • country — str | Unset — Two-letter country code to localize results (e.g. us, de), normalized to lowercase. Defaults to us.
  • language — str | Unset — Two-letter ISO-639-1 language code for results (e.g. en, fr), normalized to lowercase. Defaults to en.
  • date_range — CreateSearchBodyDateRange | Unset — Restrict results to a recency window: any (default, no time filter), hour (past hour), day (past 24 hours), week (past week), month (past month), or year (past year). Applies identically to every type; billing is unchanged.

Call styles

sync_detailed(client=client, body=body) -> Response[CreateSearchResponse200 | CreateSearchResponse503 | Error | Error]
sync(client=client, body=body) -> CreateSearchResponse200 | CreateSearchResponse503 | Error | Error | None
await asyncio_detailed(client=client, body=body) -> Response[CreateSearchResponse200 | CreateSearchResponse503 | Error | Error]
await asyncio(client=client, body=body) -> CreateSearchResponse200 | CreateSearchResponse503 | Error | Error | None