18 January Getting Started Zip Code API January 18, 2022 By Ricardo Rangel Tutorials getting started, tutorial, zip code Overview These instructions describe how to get started with the Zip Code API. The examples in this article use Postman. You can get postman here Pre-Requisites for Zip Code API Making a request for a single Zip Code Evaluating single zip code response Making a request for Zip Codes in California Evaluating search response Pre-Requisites for Zip Code API Before you start using this API, you have to complete the following: Register to Metadapi.com Subscribe to the Zip Code API using any available tier (if you are just trying this API the “free” tier is available). Get your API Key Make sure you have Postman installed. Making a request for a single zip code To get started, let’s get the Zip Code of the famous US city Beverly Hills 90210. We are interested in all of the details of that zip code. The Zip Code API host is https://global.metadapi.com/zipc/v1/zipcodes/{zipCode} and the API Key must be included as part of the header. Let’s get the call started in Postman. First create a new GET request Enter the request url to get a zip code https://global.metadapi.com/zipc/v1/zipcodes/90210 Enter the API Key header where the key name is Ocp-Apim-Subscription-Key and the Value is you API key. (get your API key). After you have the request and API Key you can click the “Send” button to execute the request. That’s it. you’ve executed the GET request for the Beverly Hills Zip Code 90210. The JSON response contains the details of the zip code. Evaluating the single Zip Code response The following is the response from the Zip Code object. The response object has 2 properties: links , with a representation of the resouce, and data with the zip code object model. To see the definition of each property of the zip code response visit this link 4. Making a request for Zip Codes in California The endpoint https://global.metadapi.com/zipc/v1/zipcodes has several query parameter options. Let’s use the stateCode query parameter to get a list of all zip codes in California. (Click here for more information on the available query parameters) Create a new GET request using the following endpoint: https://global.metadapi.com/zipc/v1/zipcodes?stateCode=CA Make sure the API Key authorization is set: Click the Send button to execute the request The request is executed and we get the JSON response. Evaluating search response The following is the response from the Zip Code object. The response object has 3 properties: links , with a representation of the resource and links to the result pages. meta with the following objects, count (how many zip codes match the criteria), offset (where in the result set the returned records start) and limit (how many zip code objects are displayed per page. Note: the zip code API always paginates the results with a Max limit of 50 zip codes per page. Data is an array of zip code objects. The limit response has the total number of zip codes in the array. Note: When no Offset or Limit query parameters are added to the request, the defaults are set to offset = 0 and limit = 10 Get the Zip Code API and start building an awesome solution! Try it Now! Related Posts Python Code to Enhance Zip Codes This blog article explains a simple Python code that opens a file with a list of zip codes and leverages the Zip Code Data API to add additional attributes about the zip code into a new enhanced file. Postman Tutorial If you are working with API’s, regardless of they type of project (data pipelines, application development, report development), you may need to work with API’s to uncover all the capabilities the API has to offer. Postman will allow you to quickly and easily get results from an API. We’ll also briefly describe other key capabilities of the tool that can be used to test code, design API’s, share additional information etc. At the end we also provide additional training resources for Postman. What is a Zip Code? This article explains the basic information about zip codes in the United States of America with a history of how they were created, and how they are used today. Dynamically Invoking REST API with Data Factory This tutorial walks trough the process of setting up a Data Factory Pipeline and invoking a REST API (using the Zip Code API as an example) as a lookup to enhance the data within the pipeline. Getting Started with Metadapi 4 easy steps to get started with Metadapi and get you up and running with any API available on this site. County Lookup by Zip Code This article aims to delve into the numerous business benefits associated with utilizing our county lookup by zip code feature in the Zip Code API. We will explore how this API can empower businesses to enhance their customer targeting, expand market reach, optimize logistics, and stay ahead of the competition. Please enable JavaScript to view the comments powered by Disqus. blog comments powered by Disqus