# Filtered Searches
source: https://developer.mastercard.com/bin-lookup/documentation/use-cases/bin-search/index.md

The `/bin-ranges` endpoint allows BIN Lookup integrators (Merchants/Acquirers/Payment Service Providers (PSPs)/Fintechs) to search for BIN range information based on one or more key/value pairs.

For example, an acquirer or PSP can use the `/bin-ranges` endpoint to build targeted BIN portfolios for a new payment program or routing rule. Before launching in a new market, the business can search the BIN dataset for specific issuers, countries, product types, or funding sources, then use the resulting range list to configure acceptance rules, tailor checkout experiences, or prepare fraud and compliance controls for the card segments that matter.

1. **Construct Payload:** Create a JSON array with key/value filter pairs. For example, `customerName`, `productCode`, or `country`.
2. **Send Request:** Submit the lookup request to the BIN Lookup API using the `POST /bin-ranges` endpoint. Send the filter in the request body. Results are paginated.
3. **Validate Response:** Check for a HTTP 200 status code. A successful response returns a JSON array of matching account ranges.
4. **Parse Results:** Extract `currentPageNumber`, `totalPages`, and `totalItems` from the response.
5. **Store Results:** Add the `items` array to your local collection.
6. **Paginate:** Increment the `page` parameter and continue fetching pages until `currentPageNumber >= totalPages`.
7. **Verify:** Confirm that the total number of items downloaded matches `totalItems`.

## Example Sequence {#example-sequence}

The following shows an example sequence of the `/bin-ranges` endpoint.

![How to filter BINs](https://static.developer.mastercard.com/content/bin-lookup/uploads/binsearch.svg "How to filter BINs")

## Endpoint Structure {#endpoint-structure}


API Reference: `POST /bin-ranges`

## Next Steps {#next-steps}

To learn how to use the filtering functionality check out the [Filtering Tutorial](https://developer.mastercard.com/bin-lookup/documentation/tutorials-and-guides/filtering-tutorial/index.md).

### Useful Links {#useful-links}

* [View the full Open API specification](https://developer.mastercard.com/bin-lookup/documentation/api-section/index.md)
* [Review the API's error responses](https://developer.mastercard.com/bin-lookup/documentation/code-and-formats/index.md)
