Skip to main content
Search the web and get structured results:
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(query="web automation tools", location="US")

for r in response.results:
    print(f"{r.position}. {r.title}")
    print(f"   {r.url}\n")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "web automation tools",
  location: "US",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
  console.log(`   ${r.url}\n`);
}
curl -s "https://api.search.tinyfish.ai?query=web+automation+tools&location=US" \
  -H "X-API-Key: $TINYFISH_API_KEY"
Output:
{
  "query": "web automation tools",
  "results": [
    {
      "position": 1,
      "site_name": "www.firecrawl.dev",
      "title": "Top 9 Browser Automation Tools for Web Testing and Scraping in ...",
      "snippet": "This guide covers 9 of the best tools across testing, scraping, and workflow automation...",
      "url": "https://www.firecrawl.dev/blog/browser-automation-tools-comparison"
    },
    {
      "position": 2,
      "site_name": "www.skyvern.com",
      "title": "Best Free Open Source Browser Automation Tools in 2025 - Skyvern",
      "snippet": "Developed by Microsoft, Playwright is the next generation of web automation tools...",
      "url": "https://www.skyvern.com/blog/best-free-open-source-browser-automation-tools-in-2025/"
    }
  ],
  "total_results": 10,
  "page": 0
}

Search with Intent

Pass the optional purpose parameter to state why you are searching — the goal the results will be used for. It is always optional, but supplying it gives the search additional intent signal beyond the raw keywords, helping deliver better-quality results.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(
    query="pdf invoice parser",
    purpose="Find an open-source library for parsing PDF invoices in Python",
)

for r in response.results:
    print(f"{r.position}. {r.title}")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "pdf invoice parser",
  purpose: "Find an open-source library for parsing PDF invoices in Python",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
}
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=pdf invoice parser" \
  --data-urlencode "purpose=Find an open-source library for parsing PDF invoices in Python" \
  -H "X-API-Key: $TINYFISH_API_KEY"

Include or Exclude Sites

Use search operators in the query string to control which domains appear in the results. Use site: to limit results to a domain, and repeat -site: to exclude domains.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(
    query="python tutorial site:docs.python.org",
    location="US",
)

for r in response.results:
    print(f"{r.position}. {r.title} ({r.site_name})")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "python tutorial site:docs.python.org",
  location: "US",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title} (${r.site_name})`);
}
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=python tutorial site:docs.python.org" \
  --data-urlencode "location=US" \
  -H "X-API-Key: $TINYFISH_API_KEY"
To exclude specific sites, add -site: terms to the query:
cURL
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=recipe ideas -site:facebook.com -site:youtube.com" \
  --data-urlencode "location=US" \
  -H "X-API-Key: $TINYFISH_API_KEY"
Get results localized to a specific country and language:
from tinyfish import TinyFish

client = TinyFish()

# Search in French — location auto-resolves to FR
response = client.search.query(query="meilleurs restaurants", language="fr")

for r in response.results:
    print(f"{r.position}. {r.title} ({r.site_name})")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();

// Search in French — location auto-resolves to FR
const response = await client.search.query({
  query: "meilleurs restaurants",
  language: "fr",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title} (${r.site_name})`);
}
curl -s "https://api.search.tinyfish.ai?query=meilleurs+restaurants&language=fr" \
  -H "X-API-Key: $TINYFISH_API_KEY"
When only language is provided, location auto-resolves to the most common pairing (e.g. frFR, jaJP). See the Reference for details.

Search + Fetch Pipeline

Combine Search with Fetch to get full page content from top results:
from tinyfish import TinyFish

client = TinyFish()

# Step 1: Search
results = client.search.query(query="TinyFish web agent", location="US")
top_urls = [r.url for r in results.results[:3]]

# Step 2: Fetch full content
pages = client.fetch.get_contents(urls=top_urls, format="markdown")
for page in pages.results:
    print(f"## {page.title}")
    print(page.text[:200], "\n")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();

// Step 1: Search
const results = await client.search.query({
  query: "TinyFish web agent",
  location: "US",
});
const topUrls = results.results.slice(0, 3).map((r) => r.url);

// Step 2: Fetch full content
const pages = await client.fetch.getContents({
  urls: topUrls,
  format: "markdown",
});
for (const page of pages.results) {
  console.log(`## ${page.title}`);
  console.log(page.text.slice(0, 200), "\n");
}

Freshness Filter

Use recency_minutes when you want a freshness window relative to now.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(query="FIFA", recency_minutes=60)

for r in response.results:
    print(f"{r.position}. {r.title}")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "FIFA",
  recency_minutes: 60,
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
}
curl "https://api.search.tinyfish.ai?query=FIFA&recency_minutes=60" \
  -H "X-API-Key: $TINYFISH_API_KEY"
Use after_date and before_date when you want a calendar date range.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(
    query="FIFA",
    after_date="2026-06-01",
    before_date="2026-06-18",
)
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "FIFA",
  after_date: "2026-06-01",
  before_date: "2026-06-18",
});
curl "https://api.search.tinyfish.ai?query=FIFA&after_date=2026-06-01&before_date=2026-06-18" \
  -H "X-API-Key: $TINYFISH_API_KEY"
Use domain_type=news to retrieve recent news articles. Results include publisher and date fields.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(query="AI regulation", domain_type="news", location="US")

for r in response.results:
    print(f"{r.position}. {r.title}")
    print(f"   {getattr(r, 'publisher', '')}{getattr(r, 'date', '')}")
    print(f"   {r.url}\n")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "AI regulation",
  domain_type: "news",
  location: "US",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
  console.log(`   ${r.publisher ?? ""}${r.date ?? ""}`);
  console.log(`   ${r.url}\n`);
}
curl "https://api.search.tinyfish.ai?query=AI+regulation&domain_type=news&location=US" \
  -H "X-API-Key: $TINYFISH_API_KEY"
Use domain_type=research_paper to search academic papers. Results include authors, venue, year, and cited_by_count fields.
from tinyfish import TinyFish

client = TinyFish()
response = client.search.query(query="attention is all you need", domain_type="research_paper")

for r in response.results:
    print(f"{r.position}. {r.title}")
    authors = getattr(r, 'authors', None) or []
    print(f"   Authors: {', '.join(authors)}")
    print(f"   Venue: {getattr(r, 'venue', '')}  Year: {getattr(r, 'year', '')}")
    print(f"   Citations: {getattr(r, 'cited_by_count', '')}")
    print(f"   {r.url}\n")
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();
const response = await client.search.query({
  query: "attention is all you need",
  domain_type: "research_paper",
});

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
  console.log(`   Authors: ${(r.authors ?? []).join(", ")}`);
  console.log(`   Venue: ${r.venue ?? ""}  Year: ${r.year ?? ""}`);
  console.log(`   Citations: ${r.cited_by_count ?? ""}`);
  console.log(`   ${r.url}\n`);
}
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=attention is all you need" \
  --data-urlencode "domain_type=research_paper" \
  -H "X-API-Key: $TINYFISH_API_KEY"

Search Reference

Full parameter and response docs

Fetch Examples

Extract page content from URLs