listStates
Retrieve a paginated list of states, provinces, or regions. Filter by name, code, or country to resolve state names to URL slugs for search results.
Instructions
List states / provinces / regions - Paginated enumeration of states/provinces/regions enabled on this site. The location_states table is country-agnostic - it holds US states, Canadian provinces, UK regions, and any other first-admin-level division for any country active on this site, distinguished by country_sn. Read-only source-of-truth for state slugs in search-result URLs.
Use when: resolving a state/province name ("California", "Ontario") to its state_filename slug (california, ontario) before constructing a search-result URL.
Pagination + filter/sort: standard. Useful filters: state_ln (full name), state_sn (2-letter code), state_filename (slug), country_sn (scope to one country - e.g. US, CA).
Returns: rows with location_id (PK - NO typo here, unlike cities), state_sn, state_ln, state_filename, country_sn.
System-critical table - create & delete deliberately omitted. States are seeded by BD as needed. Use updateState only for corrections.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Records per page (default 25, max 100) | |
| page | No | Pagination cursor (use next_page from previous response) | |
| property | No | Field name to filter by | |
| property_value | No | Value to filter by | |
| property_operator | No | Filter operator: =, LIKE, >, <, >=, <= | |
| order_column | No | Column to sort by | |
| order_type | No | Sort direction: ASC or DESC |