Date filtering information can be found here.
Overview
Our /search
endpoint allows for restricting its search scope. It supports the following:
- Restrictions: restrict the search to a set list of sources
- Exclusions: exclude a set list of sources from the search
- Prioritization: create a prioritized list of sources to search on. The information will be looked for on the sources by order of priority
To filter, we use an XML format that must be appended to the natural language q
parameter passed to the /search
endpoint.
<guidance>
<restriction>
Use only the sources listed here. Do not rely on any external references.
- wikipedia.org
</restriction>
</guidance>
Your search goes here
This structure should be used in the API as follows.
curl -X POST 'https://api.linkup.so/v1/search' \
-H 'Authorization: Bearer {{LINKUP_API_KEY}}' \
-H 'Content-Type: application/json' \
-d '{
"q": "<guidance><restriction>Use only the sources listed here. Do not rely on any external references.\n - wikipedia.org\n - sec.gov\n</restriction><priority>\n - wikipedia.org\n</priority></guidance>Who is the CEO of LVMH?",
"outputType": "sourcedAnswer",
"depth": "standard"
}'
Exclusions
Exclusions can be used to block the /search
endpoint from returning information from a given list of sources. It should be used in the format of the example below:
<guidance>
<exclusion>
Do not use any of the sources listed here.
- buzzfeed.com
</exclusion>
</guidance>
Your search goes here
Prioritization
Prioritization can be used to favor some sources. The /search
endpoint will try to find the requested information in the favored sources. If unsuccessful, it will fall back to other sources. Prioritization can be used in tiers.
<guidance>
<priority>
- wikipedia.org
</priority>
</guidance>
Your search goes here
<guidance>
<priority level='1'>
- wikipedia.org
</priority>
<priority level='2'>
- buzzfeed.com
</priority>
</guidance>
Your search goes here
Examples
The different restrictions can be used together.
Exclusion + Prioritization
<guidance>
<exclusion>Do not use any of the sources listed here.
- buzzfeed.com
</exclusion>
<priority level='1'>
- wikipedia.org
</priority>
<priority level='2'>
- imdb.com
</priority>
</guidance>
Your search goes here
Restriction + Prioritization
<guidance>
<restriction>Use only the sources listed here. Do not rely on any external references.
- wikipedia.org
- sec.gov
</restriction>
<priority>
- wikipedia.org
</priority>
</guidance>
Your search goes here