# Search results

Return ranked search results as structured records.

## Overview

Runs a search and returns ranked results as structured records with position, title, snippet, source, URL, and date, rather than a scraped results page. The corpus is selectable between general web, news, and research papers, and the result shape extends accordingly: news carries a publisher, research carries authors, venue, year, and citation count. Results can be constrained by country and language, limited to or excluded from named domains, and bounded by how recent they are.

The query, a ranked result list with position, title, snippet, URL, and date, and the total available.

## Input

These go in the `input` object of the run request.

| Field            | Type   | Required | Description                                                                 |
|------------------|--------|----------|-----------------------------------------------------------------------------|
| query            | string | Yes      | What to search for.                                                        |
| domain_type      | string | No       | Which corpus to search.<br>Allowed: web, news, research_paper<br>Default: "web" |
| location         | string | No       | Country code to target.<br>Default: "US"                                   |
| language         | string | No       | Language of the results.<br>Default: "en"                                 |
| recency_minutes  | number | No       | Only return results published within this many minutes.                     |
| page             | number | No       | Zero-based page number.<br>Default: 0<br>Minimum: 0<br>Maximum: 10       |

Requests up to 1 MB.

## Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

```bash
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"tinyfish","endpoint":"search","input":{"query":"agent gateways","domain_type":"web","location":"US","language":"en"}}'
```

## Pricing

$0 per call using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

## Questions

### What does Search results do?

### How much does Search results cost?

### What does Search results take?

### What are the limits on Search results?

### How do I retry safely and check the final charge?
