Geocoding adress doesnot give latitude and longitude - swift

Im using this URL http://maps.googleapis.com/maps/api/geocode/json?address="ADDRESS"&sensor=false?key=APIKey of our prjct. But not getting results. It shows me error eventhough I use an API Key
{
"error_message" : "Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account",
"results" : [],
"status" : "OVER_QUERY_LIMIT"
}
Unable to understand where am I going wrong. Any help would be highly appreciated

I believe http://maps.googleapis.com/maps/api/geocode/json?address="ADDRESS"&sensor=false?key=APIKey is wrong.
Have a look at this part ?key=APIKey, it should be &key=APIKey. Also note that address parameter shouldn't have " symbols and sensor parameter is not required anymore, it was deprecated long time ago.
The request should be
https://maps.googleapis.com/maps/api/geocode/json?address=ADDRESS&key=APIKey
I hope this helps!

it's clearly says,
"Keyless access to Google Maps Platform"
to use Google API's you need to register the application, and request API services.
therefore you will have an
access to your key to use, keep in mind all the API services requires Client Key and you have to provide it in the Request otherwise you can't use any of google API's.
you can generate Key after Registering here

Related

Extracting value from API/Webpage

I'm trying to retrieve the 'estimated value' field displayed on the https://www.poppriceguide.com/ website so it can be displayed in a google sheets automatically.
Example URL: https://www.hobbydb.com/marketplaces/poppriceguide/catalog_items/iron-man-model-39
I've tried using the =IMPORTXML() function as such:
=IMPORTXML(https://www.hobbydb.com/marketplaces/poppriceguide/catalog_items/iron-man-model-39, /*[contains(concat( " ", #class, " " ), concat( " ", "value", " " ))])
with no success, seemingly to be caused because it is retrieved using Javascript.
Doing some research I found poppriceguide is using Hobbydb's API which according to Hobbydb should be available.
https://help.hobbydb.com/support/solutions/articles/36000265069-access-to-the-hobbydb-api
https://help.hobbydb.com/support/solutions/articles/36000263216-adding-estimated-values-and-other-data-to-your-own-site
Going through the network calls I found this API request, however when I do it separately it gives me an authentication failed.
https://www.hobbydb.com/api/price_guide?catalog_item_id=520170
Other API Requests do work however, for example:
https://www.hobbydb.com/api/catalog_items/323645
How would I go about retrieving the value so it can dynamically be displayed in a Google sheets?
The link you shared says
Let us know if you are interested in exploring co-operation and using the API. Please provide us with a good overview of your project.
This is likely to mean that the API requires authentication
It is also possible for the API to have certain endpoints that are free, which is why some seem to work. Yet with no publicly available documentation, there is no way to know which ones.
So unfortunately you will not be able to use Apps Script for this, you could look into some other web scraping software, maybe Puppeteer. Or try and apply for an API key from HobbyDB.

Error when using the polymerize API for HMS location

When I use the polymerize API of Huawei and if I included com.huawei.instantaneous.location.sample, the polymerize API does not work --
if I do not include it, it does "work".
{"dataTypeName":"com.huawei.instantaneous.location.sample"},
{"dataTypeName":"com.huawei.instantaneous.heart_rate"},
{"dataTypeName":"com.huawei.continuous.calories.burnt"},
{"dataTypeName":"com.huawei.instantaneous.speed"}],
"startTime":1448940711000,"endTime":1448943334000}
Any idea or help?
com.huawei.instantaneous.location.sample is public atomic data types but not public statistical data types. so when you included com.huawei.instantaneous.location.sample, the polymerize API does not work.
Pls refer to this website for more info.

Provide array of URNs to LinkedIn REST API?

I am using the LinkedIn Marketing Development Platform where I am trying to provide a list of company URNs to to the Ad Analytics API. However, when I try to provide a list of company URNs, it fails with status 400.
Analytics Finder endpoint docs
My request:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CAMPAIGN&dateRange.start.day=1&dateRange.start.month=1&dateRange.start.year=2017&timeGranularity=ALL&companies=urn:li:organization:1234,urn:li:organization:5678
Response:
{"message":"Array parameter 'companies' value 'urn:li:organization:1234,urn:li:organization:5678' is invalid. Reason: Deserializing output 'urn:li:organization:1234,urn:li:organization:5678' failed","status":400}
I have also tried URL encoding the URL, and providing the list via the parameter companies[0] as is done in other examples in the docs.
What is the correct way to input arrays to the LinkedIn API?
Edit: Changed accounts to companies
So the Protocol Version actually gave me some useful insight. There are a couple of ways of providing arrays in parameters.
From the docs:
For Restli V1.0 (used by default)
GET GET https://api.linkedin.com/people?ids=1&ids=2&ids=3
For Restli V2.0, which you can use by setting the following header: X-RestLi-Protocol-Version: 2.0.0
Pass parameters in List format.
GET https://api.linkedin.com/v2/people?ids=List(1,2,3,4)
However, I have not managed to get the Analytics Finder API to work with Restli V2.0.
You'll need to provide the list of URL encoded organization URNs to the accounts param. Using your request as an example:
&accounts=List(urn%3Ali%3Aorganization%3A1234,urn%3Ali%3Aorganization%3A5678)

Google reverse geocoding no more available?

I'm getting this error when I perform a google maps reverse geocoding call (https://maps.googleapis.com/maps/api/geocode/json?latlng=44.7061609,10.5948236&key=$MY_API_KEY):
{
"error_message" : "This API project was not found. This API project may have been deleted.",
"results" : [],
"status" : "REQUEST_DENIED"
}
Just to be clear: this worked until today.
Are the API changed? Do you know a workaround/fix?
My script tracks the movable marker on the map and displays the nearest Google address, both as lat/lng and nearest full_location when the drag stops. Had the same error message (in the browser Development error message). Resolved the creation of an new API key and the script that I have now works fine PROVIDED THE SCRIPT IS RUN DIRECTLY IN A BROWSER --- BUT as soon as I run the EXACT SAME SCRIPT using an -a- tag from HTML in my PHP application the lat/lng is resolved but the corresponding nearest address now comes up with the error message -Cannot determine address at this location.- from the script.
I cannot figure out what I have to change in the code to get it to work in the application.
The API has not changed it seems. I had the same issue,
Go to Google API Console
Search for Geocoding API
Enable this for the credential and it worked for me

Got error on invoking the IBM Softlayer "getCpuMetricImage" rest API

I have an active IBM Softlayer account. I am getting the error as
{"error":"One of types passed is not in the proper container.",
"code":"SoftLayer_Exception_Metric_Tracking_Object_InvalidDataType"}
when trying to fetch the cpu metric image using the below rest API with valid Virtual_Guest_Id and Snapshot_Range":
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getCpuMetricImage/<Snapshot_Range>"
But I am getting the proper response while fetching the memory metric image using the similar rest API listed below:
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getMemoryMetricImage/<Snapshot_Range>"
First of all your REST request is wrong it should something like this:
POST https://$USERNAME:$APIKEY#api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$VSIID/getCpuMetricImage
PAYLOAD:
{
"parameters": ["day","9/2/2017"]
}
Second the method is not working currently I am going to report it, but I do not have idea when they are going to fix it.
Another thing to point out is that the Softlayer's control portal do not use that method to display the graph, so is likely that the image returned by the method and the graph in the portal are going to be different. If you want the same inforamtion I recomend you to use the same method see this forum for more information:
SoftLayer API CPU usage mismatch
The method in the forum above will return you the data of the graph and then you are going to need to represent that information in a graph using your own code.
Regards