Search
The search method on a Client instance makes a GET request to the search endpoint and returns an array of users and an array of wiki pages.
Example
// Search for users with the query "btmc"
const results = await api.search({
query: {
query: 'btmc',
mode: 'user'
}
});
Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
| options | SearchOptions | ✓ |
options.query
| Parameter | Type | Optional | Description |
|---|---|---|---|
| mode | ‘all’ | ‘user’ | ‘wiki_page’ | ✓ | Search only users, only wiki pages or both |
| query | string | ✓ | Query string to search |
| page | number | ✓ | Page number |
Returns
Promise<SearchResults>;
Types
Possible Exceptions
See the error handling documentation for more information.
invalid_json_syntaxnetwork_errorunexpected_response
Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .