API ﺏﻭ ﯼﺎﻫ


فهرست مطالب

    نمایش فهرست مطالب

Web API ﺖﺳﺍ ﻩﺪﻨﻫﺩ ﻪﻌﺳﻮﺗ ﮏﯾ ﯼﺎﯾﻭﺭ.

  • ﺪﻫﺩ ﺶﯾﺍﺰﻓﺍ ﺍﺭ ﺮﮔﺭﻭﺮﻣ ﺩﺮﮑﻠﻤﻋ ﺪﻧﺍﻮﺗ ﯽﻣ

  • ﺪﻨﮐ ﻩﺩﺎﺳ ﯼﺩﺎﯾﺯ ﺪﺣ ﺎﺗ ﺍﺭ ﻩﺪﯿﭽﯿﭘ ﻊﺑﺍﻮﺗ ﺪﻧﺍﻮﺗ ﯽﻣ

  • ﺪﻨﮐ ﻢﻫﺍﺮﻓ ﻩﺪﯿﭽﯿﭘ ﯼﺎﻫﺪﮐ ﯼﺍﺮﺑ ﺍﺭ ﯽﻧﺎﺳﺁ ﺲﮑﺘﻨﯿﺳ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯾﺍ

Web API ؟ﺖﺴﯿﭼ

API ﻒﻔﺨﻣ Application Programming Interface ﺖﺳﺍ.

Web API ﺖﺳﺍ ﺏﻭ ﯼﺍﺮﺑ ﯼﺩﺮﺑﺭﺎﮐ ﯽﺴﯾﻮﻧ ﻪﻣﺎﻧﺮﺑ ﻂﺑﺍﺭ ﮏﯾ.

API ﺪﻫﺩ ﺵﺮﺘﺴﮔ ﺍﺭ ﺏﻭ ﺮﮔﺭﻭﺮﻣ ﮏﯾ ﺩﺮﮑﻠﻤﻋ ﺪﻧﺍﻮﺗ ﯽﻣ ﺮﮔﺭﻭﺮﻣ.

Server API ﺪﻫﺩ ﺵﺮﺘﺴﮔ ﺍﺭ ﺭﻭﺮﺳ ﺏﻭ ﮏﯾ ﺩﺮﮑﻠﻤﻋ ﺪﻧﺍﻮﺗ ﯽﻣ.


API ﺮﮔﺭﻭﺮﻣ ﯼﺎﻫ

ﺪﻨﺘﺴﻫ ﯽﻠﺧﺍﺩ ﯼﺎﻫWeb API ﺯﺍ ﯼﺍ ﻪﻋﻮﻤﺠﻣ ﯼﺍﺭﺍﺩ ﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ

.ﺪﻧﺍﺩﺮﮔﺮﺑ ﺍﺭ ﺩﺭﺍﺩ ﺭﺍﺮﻗ ﻥﺁ ﺭﺩ ﺮﮔﺭﻭﺮﻣ ﻪﮐ ﯽﻧﺎﮑﻣ ﺕﺎﺼﺘﺨﻣ ﺪﻧﺍﻮﺗ ﯽﻣ Geolocation API ،ﻝﺎﺜﻣ ﻥﺍ

ﻝﺎﺜﻣ

:ﺪﯾﺭﻭﺁ ﺖﺳﺪﺑ ﺍﺭ ﺮﺑﺭﺎﮐ ﺖﯿﻌﻗﻮﻣ ﯽﯾﺎﯿﻓﺍﺮﻐﺟ ﺽﺮﻋ ﻭ ﻝﻮﻃ

const myElement = document.getElementById("demo");

function getLocation() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
  } else { 
    myElement.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) {
  myElement.innerHTML = "Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude; 
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Geolocation</h2>

<p>Click the button to get your coordinates.</p>

<button onclick="getLocation()">Try It</button>

<p id="demo"></p>

<script>
const x = document.getElementById("demo");

function getLocation() {
  try {
    navigator.geolocation.getCurrentPosition(showPosition);
  } catch {
    x.innerHTML = err;
  }
}

function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude;
}
</script>

</body>
</html>


API ﺚﻟﺎﺛ ﺺﺨﺷ ﯼﺎﻫ

API ﺪﻧﺍ ﻩﺪﺸﻧ ﻪﯿﺒﻌﺗ ﺎﻤﺷ ﺮﮔﺭﻭﺮﻣ ﺭﺩ ﺚﻟﺎﺛ ﺺﺨﺷ ﯼﺎﻫ.

.ﺪﯿﻨﮐ ﺩﻮﻠﻧﺍﺩ ﺏﻭ ﺯﺍ ﺍﺭ ﺪﮐ ﺪﯾﺎﺑ ،ﺎﻫAPI ﻦﯾﺍ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﯼﺍﺮﺑ

:ﺎﻫ ﻝﺎﺜﻣ

  • YouTube API - ﺪﯿﻫﺩ ﺶﯾﺎﻤﻧ ﺖﯾﺎﺳ ﺏﻭ ﮏﯾ ﺭﺩ ﺍﺭ ﺎﻫﻮﯾﺪﯾﻭ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ.

  • Twitter API - ﺪﯿﻫﺩ ﺶﯾﺎﻤﻧ ﺖﯾﺎﺳ ﺏﻭ ﮏﯾ ﺭﺩ ﺍﺭ ﺎﻫ ﺖﯿﯾﻮﺗ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ.

  • Facebook API - ﺪﯿﻫﺩ ﺶﯾﺎﻤﻧ ﺖﯾﺎﺳ ﺏﻭ ﮏﯾ ﺭﺩ ﺍﺭ ﮎﻮﺑ ﺲﯿﻓ ﺕﺎﻋﻼﻃﺍ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ.