# Lookup a postal code from geo location

Uses HTTP GET to accept one input record and returns the response in JSON or XML format.

Endpoint: GET /doLookupPostalCodes

## Header parameters:

  - `Accept` (string, required)
    Format of the response.
    Enum: "application/json", "*/*"

  - `Content-Type` (string, required)
    Format of the request.
    Enum: "application/json", "application/xml"

## Query parameters:

  - `t` (string)
    Transmission Reference - Serves as a unique identifier for this set of records.
    Example: "Test"

  - `id` (any, required)
    Required. The License Key issued by Melissa.
    Example: "{REPLACE-WITH-YOUR-LICENSE-KEY}"

  - `lat` (string, required)
    Required. The latitude geographic coordinate in decimal format.
    Example: "33.63756710910554"

  - `long` (string, required)
    Required. The longitude geographic coordinate in decimal format.
    Example: "-117.60695049134513"

  - `dist` (number)
    Maximum Distance - The requested maximum distance in miles.
    Example: 10

  - `recs` (number)
    Maximum Records - The requested number of records.

  - `opt` (string)
    Options - Specify which options to use for the selected action. List of options in : format. Multiple options are delimited with a ,.

For example: OptionName:Parameter,OptionName:Parameter.
- Level: - This option specifies the level of data to search. Depending on which parameter you set for Level, you can return the ZIP, ZIP+4, or ZIP and Carrier Route with your records.
  - CarrierRoute - Two fields are returned for each record:
    - PostalCode: A 5-digit postal code
    - CarrierRoute: the nearest Carrier Route.
  - Plus4 - Two fields are returned for each record:
    - PostalCode: a 9-digit ZIP+4 Postal Code.
    - CarrierRoute: the nearest Carrier Route.
  - PostalCode - Default. Returns the nearest 5-digit Postal Code.
    Enum: "Level:CarrierRoute", "Level:Plus4", "Level:PostalCode"

  - `format` (string)
    The desired format of the response.
    Enum: "json", "xml"

## Response 200 fields (application/json):

  - `Version` (string)
    The current service version number.

  - `TransmissionReference` (string)
    A pass-through of the input TransmissionReference field.

  - `TransmissionResults` (string)
    Lists error codes from any errors caused by the most recent request as a whole. For more information, see [Reverse GeoCoder Result Codes](https://docs.melissa.com/cloud-api/personator-search/result-codes.html).

  - `Results` (string)
    Comma delimited status, error codes, and change codes for the record. For more information, see [Reverse GeoCoder Result Codes](https://docs.melissa.com/cloud-api/personator-search/result-codes.html).

  - `TotalRecords` (integer)
    Total number of records.

  - `Records` (array)

  - `Records.City` (string)
    The city of the output address.

  - `Records.State` (string)
    The state of the output address.

  - `Records.PostalCode` (string)
    The postal code of the output address.

  - `Records.CarrierRoute` (string)
    Returns the 5-digit Postal Code of the output address. If the Level option is set to Plus4 this field will instead return the 9-digit ZIP+4 of the output address.

  - `Records.Latitude` (string)
    The latitude geographic coordinate of the output address.

  - `Records.Longitude` (string)
    The longitude geographic coordinate of the output address.

  - `Records.Distance` (string)
    The distance in miles between the input coordinates and the output coordinates.

## Response 400 fields (application/json):

  - `type` (string)
    The type of error that occurred.

  - `title` (string)
    A short summary of the error.

  - `status` (integer)
    The HTTP status code for the error.

  - `errors` (object)

  - `errors.$.<PropertyName>` (array)
    A detailed message about the error.

  - `traceId` (string)
    A unique identifier for the request, useful for debugging.


