XML output data from Bing Maps/virtualearth.net API with Google Docs importXML - api

I've been using Google Docs' ImportXML function to retrieve data from MapQuest's API. Unfortunately MapQuest's API doesn't offer all the data that I need, which is why I want to use Bing Maps instead. I've been trying this:
=importXML("http://dev.virtualearth.net/REST/v1/Locations?countryRegion=NL&postalCode=A2&key=$A$1&output=xml";"//Resources/Point/Latitude")
I'm getting a "imported content is empty" error, which I believe is being caused by an incorrect xpath-query. When I enter the URL in my browser manually, I do get to see correct XML output.
Can anyone help?

I believe it's a case sensitivity related issue. Workaround is json output and using this Google Sheets script: https://medium.com/#paulgambill/how-to-import-json-data-into-google-spreadsheets-in-less-than-5-minutes-a3fede1a014a
Works perfectly.

Related

GET Save Queries from log Analytics via Azure API

Hi there i'm trying to get the queries i've saved in log analytics via an API GET Request. and following the guide (even testing it from the Documentation page) doesn't work. I know the queries are there and are saved, am i missing something?
I follow this documentation:
Microsoft Docs - Saved Searches - Get
I Call the API like this:
GET
https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}?api-version=2015-03-20
Authorization: Bearer eyJ0...eXAQ
And the respons i get is this:
404 Not Found
{
"error": {
"code": "SavedSearchNotFound",
"message": "Saved search '[NAME OF MY SAVED QUERY]' could not be found."
}
}
I really cant figure out what the problem is here. Has anyone encountered this before?
Found My Answer:
The "{savedSearchId}" is supposed to be a guid... As i tried to find one at the beginning when constructing the URL i coundn't find an id for each search query. so i thought it was the name of it.
You can find the Query by clicking the three dots to the right of each saved query and click edit.
The query will show the ID for it under the name in Gray text.

Get Date From Google Custom Search API

How i can get date data like that google search. Is it possible to get it?
I never found it in google custom search API. The second picture i post is only snippet which got date and some description about it. The first picture from google search news and the second is google custom search
The following API request returns metadata, like published time, only if it is mentioned in its HTML source.
GET https://www.googleapis.com/customsearch/v1?key=APIkey&cx=CustomSearchEngineID&q=rambo
And refer to the "metatags" section
And Voila!
Hope that helps :)

Twitter API update_profile_banner

Can anyone help with using the Twitter API to upload a profile banner using the account/update_profile_banner? I have been searching on Google for so long and can't find any solution, thanks in advance
Based on https://gist.github.com/hayesdavis/97756
It looks like the docs are misleading, unless you are uploading a really small image, I expect it is critical to use multi part form data instead of encoding data in the query params.
Post your example code though, it's bad stackoverflow form to just say it doesn't work without showing the code and errors you are getting.

How can i remake the return from Google search api?

How can i use Google search api to get like on the google engine, title of website,a short description and URL. Is it possible?
I tried the api but it gives me only some information that doesn`t have a url or title to a website.
Using the Google shopping api, you can retrieve the title, short description and url. I've achieved this in a c# application where it returns a json file from the url below and parse over it.
You need a apiId to start with.
Using this url you can add search parameters after the q, in this example just searching for digital camera.
https://www.googleapis.com/shopping/search/v1/public/products?key=key&country=US&q=digital+camera
See http://code.google.com/apis/shopping/search/v1/getting_started.html
for more details
I'm not sure that I have enough information, but I find the Google Custom Search API reference page has the reference JSON/ATOM examples:
https://code.google.com/apis/customsearch/v1/reference.html
This query will get you started:
https://www.googleapis.com/customsearch/v1?key={YOURAPIKEY}&cx={cx?}&cref={cref?}&q=st%20olaf
Does this get you started?
Take care!
speeves

Using Google maps API via SSL

So, I know just recently that google maps API is now available in SSL (here).
My question is, how do I retro-fit my http google maps api script to use this?
So my http Google maps API script call looks like this:
http://maps.google.com/maps?file=api&v=3&sensor=false&key=########
They suggest via this link that to use SSL it should be this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false
I've tried retro-fitting this into my old URL format like so:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
but that no longer displays the map.
Does anyone have any suggestions on what the URL should be?
Thanks
Try this line:
https://maps.google.com/maps/api/js?v=3.5&sensor=true
Google btw suggests that you explicitly enter what version of the api you are going to use. Just entering v=3 will always return the latest version, at the moment 3.5. I believe that the current stable version is 3.3.
As Trott wrote in his answer, api key is no longer needed.
You don't need an API key to use v3, but I suppose it probably doesn't hurt. General things to try:
Open your browser's JavaScript console and see if it is reporting any problems when you load the page.
Remove the API key
Change & to just &
Copy and paste the exact link text you put above into your code, because that link text is working for me. I'm referring to this:
https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false&key=########
Of course, change ######## to your API key (or just remove it altogether).