Is there a way to programmatically access Google's search engine results? [closed]
Asked Answered
N

4

43

Does google offer a way to programmatically see their search engine results for a certain query?

I want to build a tracking application so that a user can see what rank on the google results their website is for certain keywords.

EDIT: The behavior of the program would be: every day the program queries Google for the desired phrases, sees what position the user's websites are, and emails the users an update of their positions for their phrases.

I want to be sure to comply with Google's terms of service too.

Necessity answered 15/3, 2010 at 5:35 Comment(2)
One of the best solution is to use a third party API like SerpApi.Waltner
Aug 2023 - there is no official API. There are 3rd party scrapers that provide this API, some are mentioned in this threadEuchromosome
S
25

After finding this question I have been researching as the other answers seem out of date.

The Google search API would be the obvious choice as quoted by other users however it is now been deprecated in favour of Custom Search API.

Although not obvious at first the Custom Search API does allow you to search the entire web. However the bad news is that the order of the results are not the same as a regular web search.

In conclusion it used to be possible however it is no longer. The new API (at a cost) will allow you to search the web to you will not be able to get the ranking back as required.

Soloma answered 24/8, 2011 at 8:30 Comment(2)
Yeah, a ridiculously high cost too - $5 per 1000 searches.Senghor
How does it allow me to search entire web? I have to limit it to a domain or Schema.org Types.Kanpur
B
16

I know the question is Google specific, but it doesn't hurt to try out other search engines which might be more open to API integration.

Check out DuckDuckGo's API.

Bigler answered 29/8, 2011 at 18:4 Comment(1)
Quote from the website: "An API for some of our Instant Answers, not for full search results."Bobinette
M
7

Try google custom search api. Get a developer API key from google and get a cx code for search engine. The procedure is given in my blog http://preciselyconcise.com/apis_and_installations/search_google_programmatically.php

Manicure answered 28/1, 2014 at 7:0 Comment(0)
C
2

Yes, Google provides a search API that you can use:

The Google AJAX Search API lets you put Google Search in your web pages with JavaScript. You can embed a simple, dynamic search box and display search results in your own web pages or use the results in innovative, programmatic ways. See the examples below for inspiration.

Don't let the name fool you, this API can be used for more than just JavaScript on a webpage.

Catwalk answered 15/3, 2010 at 5:37 Comment(4)
Is it okay to do this by their terms of service?Necessity
I cannot find this any more is there a replacement?Soloma
See programmers.stackexchange.com/questions/103123/…Soloma
Please update this answer as it is not valid anymoreKanpur

© 2022 - 2024 — McMap. All rights reserved.