> ## 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 Research Papers by Publication Year

> Limit research paper results to a range of publication years using pub_year_min and pub_year_max

> [!NOTE]
>
> **Capability:**`pub_year_min` + `pub_year_max`

Use this when you want papers from a specific period, such as the transformer literature between 2019 and 2022. Date filters like `after_date` do not work for research papers, so this is how you scope them by time.

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

client = TinyFish()
response = client.search.query(
    query="transformer architecture",
    domain_type="research_paper",
    pub_year_min=2019,
    pub_year_max=2022,
)

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

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

const client = new TinyFish();
const response = await client.search.query({
  query: "transformer architecture",
  domain_type: "research_paper",
  pub_year_min: 2019,
  pub_year_max: 2022,
});

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

```bash cURL theme={null}
curl -G "https://api.search.tinyfish.ai" \
  --data-urlencode "query=transformer architecture" \
  --data-urlencode "domain_type=research_paper" \
  --data-urlencode "pub_year_min=2019" \
  --data-urlencode "pub_year_max=2022" \
  -H "X-API-Key: $TINYFISH_API_KEY"
```

Both bounds are inclusive integers from `0` to `9999`. Send only one to leave the other end open. For a single year, set both to the same value.

## Common Mistakes

> [accordion] Using it without domain\_type=research\_paper
>
> `pub_year_min` and `pub_year_max` are only supported for research papers. On a web or news search the request is rejected.

> [accordion] Minimum greater than maximum
>
> When you send both, `pub_year_min` must be less than or equal to `pub_year_max`.

> [accordion] Reaching for date filters instead
>
> `recency_minutes`, `after_date`, and `before_date` are rejected for research papers. Use the publication year bounds.

## Related

> [card] [Search the Web, News, or Research Papers](https://docs.tinyfish.ai/tinysearch/how-to/result-types.md)
>
> Choose the kind of source to search

> [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.