• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

128
Views
Understanding API calls and API key embedded URLs
$get_api_url = "https://maps.googleapis.com/maps/api/place/details/json?key=$api_key&placeid=$place_id&language=$language_code";
//clean the URL
$result = file_get_contents($url);

The request above is made and received on the server side. I cannot seem to find the exact terminology used to describe the API key embedded URL.

When using JavaScript MAPs API,

let map;

function initMap() {
  map = new google.maps.Map(document.getElementById("map"), {
    center: { lat: -34.397, lng: 150.644 },
    zoom: 8,
  });
}

window.initMap = initMap;
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/jskey=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&v=weekly" defer></script>

  1. Which part of the code qualifies as an API call in both the cases?
  2. How does the response received vary in case of the client side call?
  3. Is the URL used called an endpoint?
almost 3 years ago · Santiago Trujillo
1 answers
Answer question

0

Which part of the code qualifies as an API call in both the cases?

An API call is a call to a remote function. In simple word, an API call will always return you some sort of data (JSON, XML, Plain Text etc.)

<script src="https://maps.googleapis.com/maps/api/jskey=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&v=weekly" defer></script>

This is not an API call neither and end point. Because you will notice that the URL returns Java Script. So its just an URL (location of a resource)

How does the response received vary in case of the client side call?

There is no difference if you call an API / End Point from client side or at server side. Because what you are doing is simply initiating an HTTP request and in turns it gives you back the HTTP Response.

Is the URL used called an endpoint?

https://maps.googleapis.com/maps/api/place/details/json?key=$api_key&placeid=$place_id&language=$language_code

This is an end point (to an API). You will notice that this returns some JSON data (Output of the function executed at that end point)

Hope this helps.

Note: Never expose sensitive data like API KEY and etc. with your question.

almost 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error