when using searchType = image on the API search explore no items resulted - google-apis-explorer

As of this morning (7/30/2020) my application that uses Google Search API stopped returning images results, after more in depth investigation with variety of tools ( cURL, Insomania, Postman etc ..) same results, when not using searchType = image ; results return, with image just metadata that also indicates multiple results, but the normal items[] array is not there.
Then I tried the same on Google's platform with the API explorer same behavior. What is going on ?

Now 8 hours later I tried again to execute a query with 'searchType=image" and it works; From my Angular application as well as Python script and the REST testing tools.
Also tested from the Google API explorer and now works like a charm, as it always did.
I'm guessing Google had some downtime or server malfunction and then they fixed it.
Appreciate if anyone has confirmation of the scenario I'm suspecting

Related

Force Update application by using custom api in flutter

I am getting sick of thinking about how to make application force update by controlling the json api. I want to call json api from my server and want to make your if the app is need to update and show the message box and navigate to this update application. Please share me a sample if you know how to do it in flutter. I really appreciate.
In one of my previous jobs, I was asked to add a force update function to the app. I personally don't like it when apps force update you (except when you are in a really old-old version).
This is how I did it (i am not going to paste the code, I am going to simply explain it) when the app started up we had a function that checked an API for the latest version of the app (that app worked only with internet access). If the API returned a newer version we simply displayed a msg informing the user that there is a newer version. If the API had the forceupdate value, I was displaying a msg and disabling everything. The user couldn't perform anything in the app until he updated it to the latest version.

Google Maps API for both localhost & production server, as of April 2019

TLDR
My code works fine on my laptop when accessed as file://<path>/index.html, but neither on my laptop with an Apache server running when accessed as http://<path>/index.html, nor on my real (production) server. I see no errors on the console, but the map is just a grey rectangle.
[Update] I moved to LeafletJS shortly after asking this question, and recommend others to do so too.
It has been a few years since I coded any Google Maps applications.
It seems that, as of last year, it is now necessary to have an API key, by providing it with credit card details, and to provide it with each API call.
Unfortunately, there is a lot of of information about this, much/most of it out of date and/or contradictory.
Can anyone point to the canonical guide, preferably with screenshots, of how to configure this?
I wish to draw a map, and add some makers, which will require reverse geocoding, such that I provide a street address and convert it to lat/long in order to place the markers.
Sounds simple enough, but which of the many thousands of "helpful" site has gotten it right?
For instance, what seems to be the current Google help page speaks of
From the Navigation menu, select APIs & Services > Credentials.
On the Credentials page, click Create credentials > API key
But I can't even see that menu option :-(
[Update] If it helps any, the error message in the developer console said :
Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
[Update] I am trying to access the API like this
<script src="maps.google.com/maps/api/…>
and
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + comapnyLocation +'&key=XXXX';
$http.get(url)
[Update++] in the developer console, I see a bunch of errors along the lines of:
aliextension.com/wp-content/uploads/2017/08/JAR.png:1 GET https://aliextension.com/wp-content/uploads/2017/08/JAR.png net::ERR_CONNECTION_TIMED_OUT
I have no idea what aliextension is, nor does it appear in my code (maybe in some minified JS?)
Ok, it is something to do with AliExpress (Ali Baba). I removed it & the timeout messages go away, but I still have problems.
If I load the index.html into Chrome as a file://, then it works just fine. But, if I load it `as http://, where I have a Xampp Apache server running, the map box remains grey, although I see no error messages. The same thing happens on my real server :-(
This page should be your starting point:
https://developers.google.com/maps/documentation/javascript/tutorial
it helps you working with Google map javascript API.
To embedded a google map to your website read the overview page in the above link.
To add markers to your google map read this page:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
To do reverse geocoding read this page:
https://developers.google.com/maps/documentation/javascript/geocoding
That all i need to work with google map. I think you can do the same too.
The cause for this is quite likely an API key restriction.
In order to permit these host-names or IP addresses, you have to:
a) go to the credentials panel and select the according project, then click on "Api key".
b) there you can loosen the restrictions, for HTTP referrers (for web-sites)
... or for IP addresses (in case these are server-side requests).

Google Drive for hosting JSON post 'host' discontinuation (August 2016)

While it appears that we will still be able to use google drive to host images for websites (when load speed is less of an issue than users being able to add things when they do not know any html). I have been using google apps scripts to generate JSON files that are then loaded to build webpages (This way I could have people add images to a folder, and lines on a spreadsheet and the page builds automatically). I noticed a couple of other people asking questions about this, so it is not only going to effect me. However with Google ending their 'host' feature in August, has anyone come up with a solution other than just make a small server that grabs the JSON file occasionally and hosts it in a way that allows cross domain access?
Well I found a work around inside google apps script for anyone interested. There is one large problem with it. It does not work on any safari browsers due to a known, but triaged bug. (https://code.google.com/p/google-apps-script-issues/issues/detail?id=3226) This is something I should have thought of before, as I have used it as a trick in the past:
function doGet() {
var myFile = DriveApp.getFileById('<FILE_ID>');
var str = myFile.getBlob().getDataAsString();
return ContentService.createTextOutput(str).setMimeType(ContentService.MimeType.JSON);
}
Once you have your id set up go to Publish->Deploy as Web App, set things to Execute as me, and anyone even anonymous can access. The URL https://script.google.com/macros/s//exec will allow cross domain grabs at this point.
This, I believe, will have a quota that could in theory be overwhelmed, but you can always choose to pay for more access. In my case I will just add direct access to the JSON generated by the original script so I will not hit google drive quotas, but this should work fine for any reasonably small project that does not need Safari access...

Different errors (quota, disabled, bad API key, or none) when loading Google Maps API JavaScript

We ported our site to Google maps, but we get different errors when loading a map using the JavaScript Maps API (v3 of course). Other times the map loads correctly. The two most prominent errors are:
"Google has disabled use of the Maps API for this application. See the
Terms of Service for more information
http://www.google.com/intl/en_US/help/terms_maps.html." (JS Alert)
And:
"This site has exceeded its daily quota for maps. If you are the
creator of this site, please visit the documentation to learn more."
(this is a DOM overlay)
Live minimal example:
This code is not yet live but there's a minimal example here: http://mappat.com/maptest.php. It is simply Google's own Hello World example with our key filled in and even that gives problems.
Network traffic inspection:
I noticed the first error is shown when 'AuthenticationService.Authenticate' fails (returns [0,5,0]), the second when 'QuotaService.recordEvent' returns [0,null,0]. These are remote calls from within the SDK and I don't know if these details are relevant.
What we tried:
Billing is enabled by the way and we stay way below our quota limits. I tried a lot of things already, new key, waiting a few days, turning the Maps API off and on again in the console, etc. I filled in the allowed referrers but also left it open to allow others. No difference.
I don't dare to start a new project in de dev console because this whole thing started when I did actually just that because I had (different) problems with the server-key. That server part is now working flawlessly btw, kind of ironically.
[Edit: I just tried to leave out the API key when loading the JS maps file, which, fingers crossed, seems to work. But now the server-side calls to places/searchtext start to give random "The provided API key is expired." errors, again (same reason we created the new project). Coincidence? Also, I don't like this option, especially with regards to the future (reaching 25k, going beyond and going Business Account)].
So, I'm stuck. Hence my first SO question ever. Could it be that we are blacklisted? Perhaps because of the duplicate project? Is there a way to find that out and/or to get us 'reset'? Or am I simply overlooking something?
Any help is appreciated because until we solve this, this is a deal-breaker.
Sidenote: I also filed a bug report because I think giving random errors on itself is not expected behaviour. It's up to the dev team to decide if they agree. If not, we still have a problem, hence this SO question.
I think you have a syntax error in your php var dump:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYuWR5wqux1_iTmfIWPveheIOr5PhqjEs&?>sensor=FALSE&language=en">
</script>
you have ?> just before sensor
This issue magically disappeared after a week or so.
I didn't get any response from Google, but they may have change/reset something behind the scenes, of course. The bug is still marked 'new', by the way.
My advice to others having this issue is to first check some basic things, since the individual errors I got could also result from actual things you're doing wrong (ie mistake in allowed-referers). If all seems okay after triple checking, just remove the API key from the request, test along like that for a while and retry in a couple of days.

REST Console Extension in Chrome

I am using REST Console.
I have to add multiple attachment with different parameter key. But I am not able to find option for this.
Is there is any other Extension available?
You have a couple other options:
Chrome:
Postman - REST Client
Advanced REST client
Firefox:
RESTClient
REST Easy (thanks to Nathan)
See if some of them meet your needs
I would definitely suggest DHC for chrome. For quite some time now I am using it on daily basis and I can say it works just fine and have features like saving entire requests under specific project -> method.
Here's demo: https://www.sprintapi.com/dhcs.html
Here's google chrome store link: https://chrome.google.com/webstore/detail/dhc-resthttp-api-client/aejoelaoggembcahagimdiliamlcdmfm?hl=en
If you just search for REST API console within google store you'll find many more.
All the best