prefer_published_within moves recent publications up in your search results. A result published inside the window moves up if it closely matches your query, and the newer it is, the further it moves. Older results are not removed. They still appear when they match better.
Use it when newer content is usually more useful, such as news, research, or guidance that gets revised. To leave older results out entirely, filter with published_after instead.
Add it to a search
curl -G "https://cashmere.io/api/v2/search" \
--data-urlencode "q=managing remote teams" \
--data-urlencode "prefer_published_within=2y" \
-H "Authorization: Bearer YOUR_API_KEY"
The window is a whole number and a unit: d (days), w (7 days), m (30 days) or y (365 days), up to 10 years. Pick one that matches how quickly your content goes out of date:
| Content | Window |
|---|---|
| News, daily updates | 7d |
| Articles, monthly reports | 30d |
| Research, books, long-lived archives | 2y |
Results with no publication date never move up.
A window works only with the vtups2r-1155 search model. That is the System Default, so a key with no Default Search Model set needs no change. If the search uses any other model, whether from search_model or from the key's Default Search Model, the request fails with a 400 and the code prefer_published_within_model_unsupported.
What changes in the response
scoreis rank-based while a window is on. It shows a result's position, not its relevance, so don't compare scores across searches or use them as a cutoff.- The
Cashmere-Search-Prefer-Published-Withinresponse header shows the window that was used. It is absent when no window was used.
Moving from the recency search models
If you use vtups2r-1w, vtups2r-1m or vtups2r-2y today, switch to vtups2r-1155 and add a window. As a starting point, use 7d in place of vtups2r-1w, 30d in place of vtups2r-1m, and 2y in place of vtups2r-2y. The recency search models keep working as before.
Where you switch depends on where the model is set:
- In your requests: send
search_model=vtups2r-1155&prefer_published_within=2yinstead ofsearch_model=vtups2r-2y. - On your API key: under Integrations → API Keys, edit the key and set its Default Search Model to
vtups2r-1155or System Default. Then add the window to your requests.
Over MCP
The Search Publications and Find Relevant Sources tools accept prefer_published_within, but it is hidden from the AI by default. To let the AI choose a window for each search, open Integrations → MCP Servers, edit your server, and tick prefer_published_within under Input params for those two tools.
MCP searches use the API key's Default Search Model, so set it to vtups2r-1155 or System Default before you tick the box.
Apply it to every search
To use the same window on every search a key makes, through the API or MCP, ask us to store it as a default on that key. A request can still send its own window, or send prefer_published_within=off to skip the default.
Fine-tuning
Two advanced parameters adjust the effect. Most callers never need them. Both need a window. Without one, the request fails with a 400 and the code prefer_published_within_required.
recency_boost, from 0 to 1 (default 0.4): how far recent matches move up.recency_match_rank, from 1 to 50 (default 10): how closely a recent result must match your query to move up. A recent result qualifies only if it matches at least as well as the result at this rank in the normal search. Lower is stricter.
See also
- AI Search on Licensed Content: how
/searchworks - Cashmere MCP Tools: the tools your MCP server offers