SAM.gov Cities API

City lookup and validation

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sam.gov-cities-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sam.gov-cities-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: SAM.gov Public Location Services Cities API
  description: The SAM.gov Public Location Services API provides Location Services data including Country, State, City, and ZIP code validation for data submitted to SAM.gov (System for Award Management). This API requires a valid SAM.gov Federal Government System Account API key.
  version: 1.0.0
  contact:
    name: GSA Open Technology
    url: https://open.gsa.gov/api/location-public-api/
  license:
    name: Creative Commons Zero (CC0)
    url: https://creativecommons.org/publicdomain/zero/1.0/
servers:
- url: https://api.sam.gov
  description: SAM.gov Production API
tags:
- name: Cities
  description: City lookup and validation
paths:
  /locationservices/v1/cities:
    get:
      tags:
      - Cities
      summary: Get List of Cities
      description: Retrieve a list of cities for a given country code. Supports searching by city name, active status, and city code filters. Used to validate city data being submitted to SAM.gov.
      operationId: getCities
      parameters:
      - name: api_key
        in: query
        required: true
        description: SAM.gov Federal Government System Account API key
        schema:
          type: string
      - name: cc
        in: query
        required: false
        description: Country code (ISO 3166-1 alpha-2, e.g. US for United States)
        schema:
          type: string
      - name: searchby
        in: query
        required: false
        description: Field to search by (e.g. cityname, citycode)
        schema:
          type: string
      - name: searchvalue
        in: query
        required: false
        description: Value to search for
        schema:
          type: string
      - name: q
        in: query
        required: false
        description: General query string for city name search
        schema:
          type: string
      - name: active
        in: query
        required: false
        description: Filter to active cities only (Y/N)
        schema:
          type: string
          enum:
          - Y
          - N
      - name: citycode
        in: query
        required: false
        description: City code to filter by
        schema:
          type: string
      responses:
        '200':
          description: Successful response with list of cities
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalRecords:
                    type: integer
                    description: Total number of matching records
                  cityList:
                    type: array
                    items:
                      type: object
                      properties:
                        cityCode:
                          type: string
                          description: City code
                        cityName:
                          type: string
                          description: City name
                        stateCode:
                          type: string
                          description: State/province code
                        countryCode:
                          type: string
                          description: Country code
                        activeInd:
                          type: string
                          description: Active indicator (Y/N)
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
        '500':
          description: Internal server error