Takaddun API

Fara amfani da saukin amfani da API a yau, bi misalai don koyon yadda ake amfani da shi.




GET Sami lambobin gidan waya a nesa

Tare da wannan sauƙin amfani da ƙarshen ƙarshen zaka sami jerin lambobin gidan waya waɗanda ke cikin nesa da aka ba su. Misalin buƙatar zai dawo da jerin lambobin gidan waya na musamman, cikakken jerin lambobin gidan waya da bayanan kowane lambar akwatin gidan waya.

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

API ɗinmu yana karɓar ma'aunan nesa a cikin kilomita (Tsohuwa) ko mil.

Don canza ma'auni zuwa kilomita dole ne a saka ms a cikin buƙatarku:

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

Amsar zata yi kama da wannan:

{
   "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 Samu bayanan lambobin gidan waya

Misali na gaba zai dawo da bayanan lambobin gidan waya waɗanda suka dace da tambayar nema.

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

Amsar zata yi kama da wannan:

{
   "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 Samu bayanan al'ada

Kuna iya wuce ƙarin params don samun kawai abin da kuke buƙata a cikin sakamakon, kawai ƙara fields ƙimar a cikin buƙatarku.

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

Amsar zata yi kama da wannan:

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



Fara amfani da API ɗinmu kyauta a yau!

Samu buƙatun kyauta na yau da kullun 240

+94 Kasashe masu tallafi

AD (Andorra)
AR (Argentina)
AS (Asar Amirka)
AT (Austria)
AU (Australia)
AX (Aland Islands)
AZ (Azerbaijan)
BD (Bangladesh)
BE (Belgium)
BG (Bulgaria)
BM (Bermuda)
BR (Brazil)
Flag of Belarus
BY (Belarus)
CA (Canada)
CH (Switzerland)
CL (Chile)
CO (Colombia)
CR (Costa Rica)
CY (Cyprus)
CZ (Jamhuriyar Czech)
Flag of Germany
DE (Jamus)
DK (Denmark)
DO (Jamhuriyar Dominica)
DZ (Algeria)
EE (Estonia)
ES (Spain)
FI (Finland)
FM (Micronesia)
FO (Faroe Islands)
FR (Faransa)
GB (Ƙasar Ingila)
GF (Guiana ta Faransa)
GG (Guernsey da Alderney)
GL (Greenland)
GP (Guadeloupe)
GT (Guatemala)
GU (Guam)
HR (Croatia (Hrvatska))
HU (Hungary)
IE (Ireland)
IM (Mutum (Isle of))
IN (Indiya)
IS (Iceland)
IT (Italiya)
JE (Jersey)
JP (Japan)
Flag of South Korea
KR (Korea ta kudu)
LI (Liechtenstein)
LK (Sri Lanka)
LT (Lithuania)
LU (Luxembourg)
LV (Latvia)
MC (Monaco)
MD (Moldova)
Flag of the Marshall Islands
MH (Marshall Islands)
MK (Macedonia)
MP (Arewacin Mariana)
MQ (Martinique)
MT (Malta)
Flag of Malawi
MW (Malawi)