Payload
One job’s body, for any source.
Usage
Payload()Payload types each parameter that keeps one name, placement, type and value set on every source that takes it. Any other keyword goes into the body as it is, so a source without a model of its own still runs. An unset field stays out of the body, so the API applies its own default. A payload sets exactly one input key, to a non-empty string. Otherwise it raises only for a mistake that the API would bill, and leaves each free check to the API.
Attributes
source: str-
The source that runs the job. It takes any string, because the API rejects an unknown source for free.
query: str | None-
The input of most search and product sources.
url: str | None-
The input of
universaland of the sources that take a page’s URL. product_id: str | None-
The input of product sources such as
walmart_product. prompt: str | None-
The input of
chatgpt,geminiandperplexity. video_id: str | None-
The input of
youtube_video_trainability. channel_handle: str | None-
The input of
youtube_channel. category_id: str | None-
The input of
target_category. render: Literal["html", "png", ""] | None-
htmlorpngrenders the page in a browser, and""turns off forced rendering. user_agent_type: _UserAgentType | None-
The device of the job’s user agent. A
desktop_*value draws from the same agents asdesktop. callback_url: str | None-
The URL that the API calls when the job finishes.
parse: bool | None-
Returns parsed content, which needs a dedicated parser,
parsing_instructionsorparser_preset. start_page: PositiveInt | None-
The first page to fetch.
pages: PositiveInt | None-
The number of pages to fetch, each billed as one result.
limit: int | None-
The number of results on each page, or of videos on
youtube_channel. markdown: bool | None-
Makes Markdown the default output type.
xhr: bool | None-
Makes the page’s Fetch and XHR requests the default output type, and needs
render. parser_preset: str | None-
The parser preset to parse with, which needs
parse. content_encoding: Literal["base64", "utf-8"] | None-
base64returns an image as Base64 text. client_notes: str | None-
Text that the API saves with the job.
aggregate_name: str | None-
The Result Aggregator that receives the result.
geo_location: str | None-
The location that the job appears to come from, in a format that depends on the source.
locale: str | None-
The language of the page, such as
en_USon Amazon orde-DEon Google. domain: str | None-
The target’s domain, such as
defor amazon.de. context: list[_ContextItem] | None-
keyandvalueitems that the API reads from thecontextlist. storage_type: Literal["gcs", "s3", "tos", "s3_compatible"] | None-
The Cloud Storage type that uploads the result, with Push-Pull only. Only
gcshas a live upload test. storage_url: str | None-
The bucket path that Cloud Storage uploads to. A path that ends in
.{{ extension }}names each job’s object, so it raises without{ job_id }: jobs that share a name lose their uploads and still bill.repr, validation errors and dry_run show its credentials asredacted:redacted, as the API does. The API returns a free 400 for a raw/,?or#in the secret, and accepts it percent-encoded. A document that is not valid JSON fails before any Payload code runs, so onlyPayload.model_validate_jsonredacts that error. A caller’sTypeAdapteror model that holds a Payload keeps the whole document inerrors()andjson(), credentials included. parsing_instructions: (
Annotated[
ParsingInstructions, PlainValidator(_parsing_instructions), WithJsonSchema({})
]
| None
)-
The instructions of a custom parser, which need
parse. A wrong_argsshape, or a regex that Python’srecannot compile, raises, because the API bills it with a null field. browser_instructions: list[BrowserInstruction] | None-
The browser actions to run on the page, which need
render. An instruction afterfetch_resource, or afilterthat Python’srecannot compile, raises, because the API returns 500 for it on every attempt. extra: dict[str, Any]-
Keys in the API’s shape, which oxy merges into the body. Its
contextitems follow the typed ones, and a key set both here and as a field raises. It also carries a value that an out-of-dateLiteralrejects.