search-wikipedia
ai-research-agent / search/search-wikipedia
Search
searchWikipedia()
function searchWikipedia(query, options?): object
Function to query phrase in Wikipedia Search API and return page titles, images and first few sentences of each result. Wikipedia Search API has complex documentation and is dificult to parse and clean up results.
Parameters
Parameter | Type | Description |
---|---|---|
|
| search phrase |
| { | |
|
| default=true Filter disambiguation pages |
|
| default=true Include image in results |
|
| default=200 Image size in pixels |
|
| default=1 Limit number of search results |
|
| default=false Return plain text instead of HTML |
|
| default=false Search in title only |
|
| default=3 Limit summary to this many sentences |
Returns
object
Name | Type |
---|---|
results | object [] |
Example
await searchWikipedia("JavaScript", { plainText: true })