Sgrìobhainnean API

Tòisich le bhith a ’cleachdadh ar API a tha furasta a chleachdadh an-diugh, lean na h-eisimpleirean gus ionnsachadh mar a chleachdas tu e.




GET Faigh còdan puist taobh a-staigh astar

Leis a ’cheann-uidhe furasta seo a chleachdadh gheibh thu liosta de chòdan puist a tha taobh a-staigh astar sònraichte. Tillidh an eisimpleir iarrtas liosta de chòdan puist sònraichte, liosta iomlan de chòdan puist agus mion-fhiosrachadh gach còd puist.

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

Bidh an API againn a ’gabhail ri tomhas astar ann an cilemeatairean (bunaiteach) no mìltean.

Gus an tomhas atharrachadh gu cilemeatairean feumaidh tu am ms a chuir san iarrtas agad:

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

Bidh am freagairt a ’coimhead mar seo:

{
   "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 Faigh mion-fhiosrachadh mu chòdan puist

Tillidh an eisimpleir a leanas mion-fhiosrachadh mu na còdan puist a tha a ’freagairt ris a’ cheist rannsachaidh.

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

Bidh am freagairt a ’coimhead mar seo:

{
   "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 Faigh dàta gnàthaichte

Faodaidh tu pasgain a bharrachd a thoirt seachad gus dìreach na tha a dhìth ort fhaighinn anns na toraidhean, dìreach cuir na fields luach san iarrtas agad.

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

Bidh am freagairt a ’coimhead mar seo:

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



Tòisich a ’cleachdadh an API againn an-asgaidh an-diugh!

Faigh 240 iarrtas an-asgaidh gach latha

+94 Dùthchannan le taic

AD (Andorra)
AR (Argentina)
AS (Samoa Ameireaganach)
AT (An Ostair)
AU (Astràilia)
AX (Eileanan Aland)
AZ (Azerbaijan)
BD (Bangladesh)
BE (A 'Bheilg)
BG (Bulgaria)
BM (Bermuda)
BR (Brazil)
Flag of Belarus
BY (Beloruisia)
CA (Canada)
CH (An Eilbheis)
CL (Chile)
CO (Columbia)
CR (Costa Rica)
CY (Ciopras)
CZ (Poblachd na Seice)
Flag of Germany
DE (A 'Ghearmailt)
DK (An Danmhairc)
DO (Poblachd Dominica)
DZ (Algeria)
EE (Estonia)
ES (An Spainn)
FI (Suomaidh)
FM (Micronesia)
FO (Na h-Eileanan Fàrach)
FR (An Fhraing)
GB (An rioghachd aonaichte)
GF (Guiana Frangach)
GG (Guernsey agus Alderney)
GL (A 'Ghraonlainn)
GP (Guadeloupe)
GT (Guatemala)
GU (Guam)
HR (Croatia (Hrvatska))
HU (An Ungair)
IE (Èirinn)
IM (Man (Eilean))
IN (Na h-Innseachan)
IS (Innis Tìle)
IT (An Eadailt)
JE (Jersey)
JP (Iapan)
Flag of South Korea
KR (Coirea a Deas)
LI (Liechtenstein)
LK (Sri Lanka)
LT (Lithuania)
LU (Lugsamburg)
LV (Latbhia)
MC (Monaco)
MD (Moldabhia)
Flag of the Marshall Islands
MH (Na h-Eileanan Marshall)
MK (Macedonia)
MP (An h-Eileanan Tuath Mariana)
MQ (Martinique)
MT (Malta)
Flag of Malawi
MW (Malawi)
MX (Megsago)
MY (Malaysia)
Flag of New Caledonia
NC (Caledonia Nuadh)
NL (An Òlaind An)
NO (Nirribhidh)
NZ (Sealainn Nuadh)
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 (Phillippines)
Flag of Pakistan
PK (Pacastan)
PL (A 'Pholainn)
PM (Saint Pierre agus Miquelon)
the star is in the center of gravity of the triangle, so the x-pos is irrational (tan(30 deg) * 15)
PR (Puerto Rico)
PT (A 'Phortagail)
PW (Palau)
RE (Ath-chruinneachadh)
RO (Romania)
RS (Serbia)
RU (An Ruis)
SE (An t-Suain)
SG (Singapore)
Flag of Slovenia
SI (Slobhinia)
SJ (Svalbard Agus Jan Mayen Islands)
Flag of Slovakia
SK (Slobhagia)
SM (San Marino)
TH (Thailand)
TR (An Tuirc)
UA (Ugrain)
US (Na Stàitean Aonaichte)
Flag of Uruguay
UY (Uruguay)
Flag of Vatican City
VA (Stàit Cathair na Bhatacain)
VI (Eileanan Virgin (SA))
WF (Eileanan Wallis Agus Futuna)
YT (Mayotte)
ZA (Afraga a-Deas)