# tokens.search

```javascript
(async() => {
    let token_search_1 = await SOLPay.tokens.search("symbol", "USDC"); // {"tokens": [...]}
    let token_search_2 = await SOLPay.tokens.search("symbol", "USDC", "equals"); // {"tokens": [...]}
    let token_search_3 = await SOLPay.tokens.search("symbol", "USDC", "equals", true); // {"tokens": [...]}
})();
```

### Parameters:

* search: string - what to use to search (`address`, `name`, `symbol`)
* param: string - the parameter/search term to use to find a token
* compare\_type (optional, default: `"equals"`): string - how to compare the search for tokens (`equals`, `startsWith`, `endsWith`, `includes`)
* skip\_validation (optional, default: `false`): boolean - whether to skip validation on if a token in the SPL token registry is a valid SPL token (true for skipping validation, false for not skipping validation), it is recommended to set this field to true when a large number of tokens are being returned and you want the function to execute quickly

### Returns:

object (`{"tokens": [...]}`) - the list of tokens (see <https://github.com/solana-labs/token-list/blob/main/src/tokens/solana.tokenlist.json> for format)

### Throws:

* `SOL Pay SDK Fatal Error: Invalid search ${search}.` - an invalid search was used
* `SOL Pay SDK Fatal Error: Invalid compare type ${compare_type}.` - an invalid compare type was used
* `SOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network.` - could not find a connection to the Solana network
* `SOL Pay SDK Fatal Error: Connection did not respond. Use SOLPay.connectNetwork() to connect to the Solana network.` - did not receive response from Solana network


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://solpay-docs.solblaze.org/reference/sdk-reference/tokens-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
