Nyaraka za API

Anza kutumia API yetu rahisi kutumia leo, fuata mifano ili ujifunze jinsi ya kuitumia.




GET Pata misimbo ya posta kwa mbali

Ukiwa na sehemu rahisi ya kutumia mwisho utapata orodha ya nambari za Posta ambazo ziko katika umbali fulani. Mfano wa ombi utarudisha orodha ya nambari za kipekee za posta, orodha kamili ya nambari za posta na maelezo ya kila nambari ya posta.

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

API yetu inakubali vipimo vya umbali katika kilomita (Chaguomsingi) au maili.

Kubadilisha kipimo kuwa kilomita lazima uweke param ya ms katika ombi lako:

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

Jibu litaonekana kama hii:

{
   "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 Pata maelezo ya misimbo ya posta

Mfano ufuatao utarudisha maelezo ya nambari za posta zinazolingana na swala la utaftaji.

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

Jibu litaonekana kama hii:

{
   "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 Pata data ya kawaida

Unaweza kupita Vigezo ziada ya kupata tu nini unahitaji katika matokeo, tu kuongeza thamani fields katika ombi lako.

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

Jibu litaonekana kama hii:

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



Anza kutumia API yetu bure leo!

Pata maombi 240 ya bure ya kila siku

+94 Nchi zinazoungwa mkono

AD (Andorra)
AR (Argentina)
AS (Samoa ya Marekani)
AT (Austria)
AU (Australia)
AX (Visiwa vya Aland)
AZ (Azerbaijan)
BD (Bangladesh)
BE (Ubelgiji)
BG (Bulgaria)
BM (Bermuda)
BR (Brazil)
Flag of Belarus
BY (Belarus)
CA (Canada)
CH (Uswisi)
CL (Chile)
CO (Kolombia)
CR (Costa Rica)
CY (Kupro)
CZ (Jamhuri ya Czech)
Flag of Germany
DE (Ujerumani)
DK (Denmark)
DO (Jamhuri ya Dominika)
DZ (Algeria)
EE (Estonia)
ES (Hispania)
FI (Finland)
FM (Micronesia)
FO (Visiwa vya Faroe)
FR (Ufaransa)
GB (Uingereza)
GF (Guyana ya Kifaransa)
GG (Guernsey na Alderney)
GL (Greenland)
GP (Guadeloupe)
GT (Guatemala)
GU (Guam)
HR (Kroatia (Hrvatska))
HU (Hungary)
IE (Ireland)
IM (Mtu (Isle of))
IN (Uhindi)
IS (Iceland)
IT (Italia)
JE (Jersey)
JP (Japan)
Flag of South Korea
KR (Korea Kusini)
LI (Liechtenstein)
LK (Sri Lanka)
LT (Lithuania)
LU (Luxemburg)
LV (Latvia)
MC (Monaco)
MD (Moldova)
Flag of the Marshall Islands
MH (Visiwa vya Marshall)
MK (Makedonia)
MP (Visiwa vya Mariana Kaskazini)
MQ (Martinique)
MT (Malta)
Flag of Malawi
MW (Malawi)