> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinyfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search the Web, News, or Research Papers

> Choose general web results, news articles, or academic papers using domain_type

> [!NOTE]
>
> **Capability:**`domain_type`

Use this when you want a specific kind of source: breaking news with a publisher and date, or academic papers with authors and citation counts. Without it, a search returns general web results.

![Search Playground with Result type set to news, searching for AI regulation and returning news articles with publisher and date](https://mintcdn.com/tinyfish/ADytV_7b8TFoYDf0/images/tinysearch-howto/result-types.gif?s=247b20d557a02f1e42c87dbd87ac1355)

## Search news

```python Python theme={null}
from tinyfish import TinyFish

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

for r in response.results:
    print(f"{r.position}. {r.title}")
    print(f"   {getattr(r, 'publisher', '')} — {getattr(r, 'date', '')}")
```

```typescript TypeScript theme={null}
import { TinyFish } from "@tiny-fish/sdk";

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

for (const r of response.results) {
  console.log(`${r.position}. ${r.title}`);
  console.log(`   ${r.publisher ?? ""} — ${r.date ?? ""}`);
}
```

```bash cURL theme={null}
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=AI regulation" \
  --data-urlencode "domain_type=news" \
  -H "X-API-Key: $TINYFISH_API_KEY"
```

News results add `publisher` and `date` to each result.

## Search research papers

```python Python theme={null}
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:
    authors = getattr(r, "authors", None) or []
    print(f"{r.position}. {r.title} ({getattr(r, 'year', '')})")
    print(f"   {', '.join(authors)} — cited by {getattr(r, 'cited_by_count', '')}")
```

```typescript TypeScript theme={null}
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} (${r.year ?? ""})`);
  console.log(`   ${(r.authors ?? []).join(", ")} — cited by ${r.cited_by_count ?? ""}`);
}
```

```bash cURL theme={null}
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"
```

Paper results add `authors`, `venue`, `year`, `cited_by_count`, and `pdf_url`.

## Common Mistakes

> [accordion] Using date filters with research papers
>
> `recency_minutes`, `after_date`, and `before_date` are not supported for `domain_type=research_paper`, and the request is rejected. To limit papers by year, see [Search research papers by publication year](https://docs.tinyfish.ai/tinysearch/how-to/papers-by-year.md).

> [accordion] Expecting the same fields on every result type
>
> `publisher` only appears on news results, and `authors`, `venue`, and `cited_by_count` only on paper results. Read them defensively, as the samples above do.

## Related

> [card] [Search Research Papers by Publication Year](https://docs.tinyfish.ai/tinysearch/how-to/papers-by-year.md)
>
> Limit paper results to a range of years

> [card] [TinySearch API Reference](https://docs.tinyfish.ai/tinysearch/reference)
>
> Every parameter, accepted value, and error code


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.