Mexico Google Search API

The definitive guide of Mexico SERP API to get Google Search Results from Mexico within the 642 places.

SERP API for Mexico

In this page we want to guide you about how to get Google Search Results from anywhere in Mexico. Currently, we support 642 places which means you can get Google Search results from 642 different location in Mexico via our SERP API for Mexico

How to get Google Search Results from Mexico

Google operates its job in more than 150 countries around the globe and offers a unique "google domain" for each countries. For instance if you want to get search results from Mexico you need to pass google_domain as parameter to our API.

1. Obtain the valid API Key

In order to use our service, you need a valid API Key that we generated for you with free credits so that you test our service before deciding. If you are not our member please click here to create your account and obtain your API Key. After you pass your key to the API URL, It will look like this https://api.avesapi.com/search?apikey=XXXXXXX&type=web

type=web parameter means we want to get Google Web Search results from Mexico and we use this as default. https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza

2. Add your search term (query)

Query parameter is mandatory. This represents what are you looking for at Google. So add your query parameter to SERP API as query=pizza. You will be searching pizza term in Google Web results and your API request will look like this

3. Add google.com.mx as Google Domain for Mexico

Once you pass the parameter google_domain=google.com.mx the API URL will look like this
https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx

4. Add GL Parameter as country code

In addition to google_domain parameter you need to specify gl code for the country which you want to get results from. In this case, you should add gl=mx parameter to obtain search results in Mexico. So your API URL will look like this
https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx&gl=mx

Our crawler is ready for scraping Google search results from anywhere in Mexico randomly since we have not provided the location yet!

5. Add HL Parameter as language code

If your business requires the results with the used language of the country you can use hl parameter to do so. According to our use case we need to provide hl=es parameter. By doing so, your Google search results will be Español. Example SERP API URL will be like this below; https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx&gl=mx&hl=es

6. Specify your device

Google results may varies regarding your device you use. For this reason you should pay attention in which device you desire to get results such as desktop or mobile. If you don't provide device our crawler use desktop result as default. To scrape result by specific device please add device=desktop or device=mobile parameter to our SERP API URL. So It will look like this https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx&gl=mx&hl=es&device=desktop

7. Provide output

While scraping Google search results, the output format is an important factor in order to integrate your solutions. We support 2 types of output format as JSON or HTML. If you want to get result as JSON you should add output=json or you need HTML result then use output=html. For example, SERP API URL will look like this with json output. https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx&gl=mx&hl=es&device=desktop&output=json

8. Specify result count

By default, Google returns 10 results for each query. Some of the query may have different SERP features such as video, image, twitter as well. If you have your own rank tracker 10 results will not be enough. Somehow you should visit other pages regarding the query. At this point, we offer our customers to num parameter and you can get Top-100 results which means the results of first 10 pages by adding num=100 at the end of the API URL. https://api.avesapi.com/search?apikey=XXXXXXX&type=web&query=pizza&google_domain=google.com.mx&gl=mx&hl=es&device=desktop&output=json&num=100