---
updatedAt: 2026-08-14T00:04:41.000Z
---

# List cities

Retrieve a list of cities with optional filtering and search capabilities.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Reference Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/ref/cities": {
      "get": {
        "operationId": "ref_cities_list",
        "description": "Retrieve a list of cities with optional filtering and search capabilities.",
        "summary": "List cities",
        "parameters": [
          {
            "in": "query",
            "name": "country_code_2",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code_2__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "country_code_2__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "country_code_2__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code_2__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "country_code_3",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code_3__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "country_code_3__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "country_code_3__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country_code_3__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "geoname",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "geoname__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "geoname__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "geoname__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "geoname__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "metro_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "metro_code__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "metro_code__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "metro_code__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "metro_code__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name__contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "name__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "name__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name__not_contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "name": "order",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_code__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "region_code__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "region_code__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_code__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "region_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_name__contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_name__in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "region_name__isempty",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "region_name__not",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_name__not_contains",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region_name__not_in",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Geo Targeting"
        ],
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCityList"
                }
              }
            },
            "description": "Cities retrieved successfully."
          },
          "400": {
            "description": "Invalid request parameters."
          },
          "401": {
            "description": "Authentication required."
          },
          "403": {
            "description": "Permission denied."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "City": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "description": "Name of the city",
            "maxLength": 80
          },
          "country_code_2": {
            "type": "string",
            "nullable": true,
            "description": "2-character country code, e.g. \"US\"",
            "maxLength": 2
          },
          "country_code_3": {
            "type": "string",
            "nullable": true,
            "description": "3-character country code, e.g. \"USA\"",
            "maxLength": 3
          },
          "region_code": {
            "type": "string",
            "nullable": true,
            "description": "ID for the region code for the city, e.g. \"NY\"",
            "maxLength": 3
          },
          "region_name": {
            "type": "string",
            "nullable": true,
            "description": "Name of the region, e.g. \"New York\"",
            "maxLength": 80
          },
          "metro_code": {
            "type": "string",
            "nullable": true,
            "description": "ID of the metro area for the city",
            "maxLength": 10
          },
          "geoname": {
            "type": "string",
            "description": "Unique ID of the city, referencing the Geonames database",
            "maxLength": 20
          }
        },
        "required": [
          "geoname",
          "id",
          "name"
        ]
      },
      "PaginatedCityList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/City"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "nestBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      },
      "nestSessionAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      }
    }
  },
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python",
    "php",
    "java"
  ],
  "servers": [
    {
      "url": "https://{buzz_key}.api.beeswax.com/rest/v2",
      "variables": {
        "buzz_key": {
          "default": "stingersbx",
          "description": "Unique customer ID assigned by the Beeswax"
        }
      }
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true,
    "apply-tag-changes": true
  }
}
```