I am using google image search API. Till yesterday it was working, but today morning it says "This API is no longer available"
Is it officially closed, Or any error at my side
Request
https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=cute+kittens
Response
{"responseData": null, "responseDetails": "This API is no longer available.", "responseStatus": 403}
Clearing Cache and Cookies Your Internet browser's cache stores data, while cookies are small pieces of information from websites stored on your computer. If you have too many cookies and data in your cache, however, your browser may not function properly and images -- including image searches -- may not load.
Google Reverse Image API allows to get results for image search https://images.google.com . The API is accessed through the following endpoint: /search? engine=google_reverse_image .
Specifically, their Google Image Search API enables you to scrape and access image search results on Google in real-time. You can use similar parameters as for a standard Google search when searching for an image.
This will include removing the View Image button. The Visit button remains, so users can see images in the context of the webpages they're on," Google said in a tweet. Google added that the changes were partly due to its settlement with Getty Images.
Now You can search images with Custom image search API.
You can do this with two steps:
Go to - https://cse.google.ru/cse/all
Here you must create new Search Engine. Do this and enable Image Search at there.
Screen(i am Russian... sorry)
then get this search engine ID. To do this press at Get Code button:
And there find line with cx = "here will be your CUSTOM_SEARCH_ID":
Ok. It's done, now second step:
Go to google Console - https://console.developers.google.com/project
Press to Create project button, enter the name and other required information. Pick this project and go to Enable Apis Now find Custom Search Engine.
And Enable it.
Now we must go to Credentials and create new Server Key:
Ok. Now we can use Image Search.
Query:
https://www.googleapis.com/customsearch/v1?key=SERVER_KEY&cx=CUSTOM_SEARCH_ID&q=flower&searchType=image&fileType=jpg&imgSize=xlarge&alt=json
Replace the SERVER_KEY and CUSTOM_SEARCH_ID and call this request.
Limit: for free you can search only 100 images per day.
The answer I found was using Google's Custom Search Engine (CSE) API. Note that this is limited to 100 free requests per day.
cx
and modifying it to search for imagescx
in your browser URL.The API endpoint url is https://www.googleapis.com/customsearch/v1
The following JSON parameters are used for this API:
q
: specifies search textnum
: specifies number of results. Requires an integer value between 1 and 10 (inclusive)start
: the "offset" for the results, which result the search should start at. Requires an integer value between 1 and 101.imgSize
: the size of the image. I used "medium"
searchType
: must be set to "image"
filetype
: specifies the file type for the image. I used `"jpg", but you can leave this out if file extension doesn't matter to you.key
: an API key, obtained from https://console.developers.google.com/ cx
: the custom search engine ID from the previous sectionSimply make a GET
request by passing above parameters as JSON to the API endpoint (also listed above).
Note: If you set a list of referrers in the search engine settings, visiting the URL via your browser will likely not work. You will need to make an AJAX call (or the equivalent from another language) from a server specified in this list. It will work for only the referrers which were specified in the configuration settings.
Reference: https://developers.google.com/custom-search/json-api/v1/reference/cse/list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With