Documentazione API

Cuminciate à aduprà a nostra API faciule da aduprà oghje, seguitate l'esempii per amparà à aduprà.




GET Uttenite codici postali in una distanza

Cù questu endpoint faciule da uttene uttene un elencu di codici postali chì si trovanu à una distanza determinata. L'esempiu di dumanda ritorna un elencu di codici postali unici, un elencu cumpletu di codici postali è i dettagli di ogni codice postale.

GET https://postalcodes.app/api/v1/?key=YOUR-APIKEY&distance=25&zipcode=10005&country=us

A nostra API accetta misure di distanza in chilometri (Default) o miglia.

Per cambià a misura in chilometri duvete mette u ms in a vostra dumanda:

GET https://postalcodes.app/api/v1/?key=YOUR-APIKEY&ms=km&distance=25&zipcode=10005&country=us

A risposta serà cusì:

{
   "query":{
      "code": "10005",
      "country": "US",
      "range": "25",
      "measure": ""
   },
   "results":{
       "range_codes_unique": ["07010", "07020", "07022", "07024", "07026", ...],
       "range_codes": ["07010", "07020", "07022", "07024", "07026", ...],
       "range_codes_details": [
          {
              "postal_code":"07010",
              "country_code":"US",
              "city":"Cliffside Park",
              "state":"New Jersey",
              "state_code":"NJ",
              "province":"Bergen",
              "province_code":"003"
          },
          {
              "postal_code":"07020",
              "country_code":"US",
              "city":"Edgewater",
              "state":"New Jersey",
              "state_code":"NJ",
              "province":"Bergen",
              "province_code":"003"
          },
          {
              "postal_code":"07022",
              "country_code":"US",
              "city":"Fairview",
              "state":"New Jersey",
              "state_code":"NJ",
              "province":"Bergen",
              "province_code":"003"
          },
          {
              "postal_code":"07024",
              "country_code":"US",
              "city":"Fort Lee",
              "state":"New Jersey",
              "state_code":"NJ",
              "province":"Bergen",
              "province_code":"003"
          },
          {
              "postal_code":"07026",
              "country_code":"US",
              "city":"Garfield",
              "state":"New Jersey",
              "state_code":"NJ",
              "province":"Bergen",
              "province_code":"003"
          },
           ...
       ],
   }
}

GET Uttenite i dettagli di i codici postali

L'esempiu seguente restituverà i dettagli di i codici postali chì currispondenu à a ricerca di ricerca.

GET https://postalcodes.app/api/v1/?key=YOUR-APIKEY&zipcode=10005&country=us

A risposta serà cusì:

{
   "query":{
      "code": "10005",
      "country": "us",
      "range": "",
      "measure": ""
   },
   "results":{
       "range_codes_unique": ["10005"],
       "range_codes": ["10005"],
       "range_codes_details": [
          {
              "postal_code":"10005",
              "country_code":"US",
              "city":"New York",
              "state":"New York",
              "state_code":"NY",
              "province":"New York",
              "province_code":"061"
          }
       ],
   }
}

GET Uttenite dati persunalizati

Pudete passà params extra per uttene solu ciò chì avete bisognu in i risultati, basta aghjunghje i fields valore in a vostra richiesta.

GET https://postalcodes.app/api/v1/?key=YOUR-APIKEY&fields=["range_codes_unique"]&distance=25&zipcode=10005&country=us

A risposta serà cusì:

{
   "query":{
      "code": "10005",
      "country": "US",
      "range": "25",
      "measure": ""
   },
   "results":{
       "range_codes_unique": ["07010", "07020", "07022", "07024", "07026", ...]
   }
}



Cuminciate à aduprà a nostra API gratuitamente oghje!

Uttenite 240 richieste gratuite ogni ghjornu

+94 Paesi supportati

AD (Andorra)
AR (Argentina)
AS (Samoa Americana)
AT (Austria)
AU (Australia)
AX (Isole Aland)
AZ (Azerbaijan)
BD (Bangladesh)
BE (Belgica)
BG (Bulgaria)
BM (Bermuda)
BR (Brasile)
Flag of Belarus
BY (Bielorussia)
CA (Canada)
CH (Svizzera)
CL (Chilì)
CO (Culombia)
CR (Costa Rica)
CY (Cipru)
CZ (Repubblica Ceca)
Flag of Germany
DE (Alemagna)
DK (Danimarcu)
DO (Republica Dumenicana)
DZ (Algeria)
EE (Estonia)
ES (Spagna)
FI (Finlandia)
FM (Micronesia)
FO (Isole Faroe)
FR (Francia)
GB (Regnu Unitu)
GF (Guyana Francese)
GG (Guernsey è Alderney)
GL (Groenlandia)
GP (Guadalupa)
GT (Guatemala)
GU (Guam)
HR (Croazia (Hrvatska))
HU (Ungheria)
IE (Irlanda)
IM (Man (Isle of))
IN (India)
IS (Islanda)
IT (Italia)
JE (Jersey)
JP (Giappone)
Flag of South Korea
KR (Corea di u Sud)
LI (Liechtenstein)
LK (Sri Lanka)
LT (Littuania)
LU (Lussemburgu)
LV (Latvia)
MC (Monacu)
MD (Moldova)
Flag of the Marshall Islands
MH (Isule Marshal)
MK (Maccedonia)
MP (Isule Mariana Settentriunali)
MQ (Martinica)
MT (Malta)
Flag of Malawi
MW (Malawi)
MX (Messicu)
MY (Malesia)
Flag of New Caledonia
NC (Nova Caledonia)
NL (Paesi Bassi)
NO (Nurvegia)
NZ (Nova Zelanda)
PE (Peru)
Flag of the Philippines Coding according to the official "description and specification of the FILIPINO flag" in Executive Order No. 23 from 1936
PH (Filippine)
Flag of Pakistan
PK (Pacchistanu)
PL (Pulonia)
PM (Saint Pierre e Miquelon)
the star is in the center of gravity of the triangle, so the x-pos is irrational (tan(30 deg) * 15)
PR (Portu Riccu)
PT (Portugallu)
PW (Palau)
RE (Riunione)
RO (Rumenia)
RS (Serbia)
RU (Russia)
SE (Svezia)
SG (Singapore)
Flag of Slovenia
SI (Slovenia)
SJ (Isole Svalbard And Jan Mayen)
Flag of Slovakia
SK (Slovacchia)
SM (San Marinu)
TH (Tailanda)
TR (Turchia)
UA (Uccrainia)
US (Stati Uniti)
Flag of Uruguay
UY (Uruguay)
Flag of Vatican City
VA (Città del Vaticano (Santa Sede))
VI (Isole Vergini (US))
WF (Isole Wallis è Futuna)
YT (Mayotte)
ZA (Africa di u Sudu)