I wrote a script to find the position in Google search result for a search keyword. I also did the same with the browser. The two results are different.

Let me explain in detail here. I have a website and I wanted to know on which page number my domain appears for a search string. Like when I search for 'code snippets' I wanted to find in Google search on which page number a certain domain appears.

I wrote a PHP script to search page by page starting from page 1 to page n. Then I did the same task using a browser. The script returned page 4 and when browsed I can see the domain appearing on the second page.

Here is the search string I used in my code.


For each request I change the start=0 to start=1, start=2, etc., and in the response I will check whether my domain appears in it.

Any idea why this is different in search results?

  • 1
    Do you send the same HTTP request headers that your browser sends? Is your script running on the same IP address as your browser, ie. the same location?
    – MrWhite
    Sep 18, 2012 at 8:58
  • Related - webmasters.stackexchange.com/questions/24783/…
    – mvark
    Sep 19, 2012 at 15:24
  • yes... yet i use to copy a recent user agent string from the browser and use the same url... Jan 25, 2013 at 5:40

1 Answer 1


The first reason that come to mind is that you're using a browser where you did the login. So Google is improving your experience personalizing the SERPs.

Just to be sure that your software is well written, you can compare the results against another software like this one I made: Site Seeker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.