> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/api-targets/pt-br/search-engines/google/shopping.md).

# Compras

Veja como fazer scraping do Google Shopping em duas etapas: gere tokens da pesquisa e depois extraia informações detalhadas do produto.

As fontes do Google Shopping foram projetadas para reunir dados de SERP e de listagens de produtos por meio de `google_shopping_search` e `google_shopping_product` fontes, respectivamente. A extração de dados é um processo em duas etapas mostrado abaixo.

### **Etapa 1: Gerar o token**

Primeiro, você precisa enviar uma solicitação ao `google_shopping_search` [source](/api-targets/pt-br/search-engines/google/shopping/shopping-search.md). Esta etapa é essencial porque gera o **token do produto**, que é necessário para coletar dados de produtos posteriormente. Abaixo está um payload JSON básico para `google_shopping_search` solicitação:

```json
{
  "source": "google_shopping_search",
  "query": "google_pixel",
  "render": "html",
  "parse": true
}
```

{% hint style="warning" %}
**Importante:** Somente jobs parseados renderizados retornarão tokens de produto.
{% endhint %}

Quando o job for concluído, você encontrará o token na resposta, na `organic` seção:

```json
{
    "results": [
        {
            "content": {
                "url": "https://www.google.com/search?q=google_pixel&gl=us&hl=en&udm=28&sei=1uDkaLnMNPCNxc8P67XmqQg",
                "page": 1,
                "results": {
                    "paid": [],
                    "organic": [
                        {
                            "pos": 1,
                            "url": "https://www.google.com/shopping/product/547163035992318172?q=google_pixel&gl=us&hl=en&udm=28&sei=1uDkaLnMNPCNxc8P67XmqQg&gl=US",
                            "type": "grid",
                            "price": 899,
                            "title": "Google Pixel 9 Pro XL",
                            "token": "eyJjYXRhbG9naWQiOiAiNTQ3MTYzMDM1OTkyMzE4MTcyIiwgImdwY2lkIjogIjQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAiaW1hZ2VEb2NpZCI6ICIxMjMwMTAyNDkzMzk0Mjg2MjY4IiwgIm1pZCI6ICI1NzY0NjI3ODc4NTM5Njc1NDAiLCAicHZvIjogIjIzIiwgInB2dCI6ICJoZyIsICJyZHMiOiAiUENfNDQyNjAwODYwNjUwMjA1Nzg1OXxQUk9EX1BDXzQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAicXVlcnkiOiAiZ29vZ2xlX3BpeGVsIn0=",
```

Cada token de produto coletado nos resultados parseados representa um único resultado orgânico.

{% hint style="info" %}
**Observação:** Sem um token gerado, não é possível recuperar informações de produto ou de preço.
{% endhint %}

### **Etapa 2: Usar o token na solicitação de produto**

Para começar a coletar dados de produtos, use o token gerado na sua solicitação ao `google_shopping_product` [source](/api-targets/pt-br/search-engines/google/shopping/shopping-product.md):

```json

{
  "source": "google_shopping_product",
  "query": "eyJjYXRhbG9naWQiOiAiNTQ3MTYzMDM1OTkyMzE4MTcyIiwgImdwY2lkIjogIjQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAiaW1hZ2VEb2NpZCI6ICIxMjMwMTAyNDkzMzk0Mjg2MjY4IiwgIm1pZCI6ICI1NzY0NjI3ODc4NTM5Njc1NDAiLCAicHZvIjogIjIzIiwgInB2dCI6ICJoZyIsICJyZHMiOiAiUENfNDQyNjAwODYwNjUwMjA1Nzg1OXxQUk9EX1BDXzQ0MjYwMDg2MDY1MDIwNTc4NTkiLCAicXVlcnkiOiAiZ29vZ2xlX3BpeGVsIn0=",
  "parse": true
}
```

{% hint style="warning" %}
**Importante:** Se um token inválido ou gerado incorretamente for usado, o job falhará.
{% endhint %}

Ao usar parâmetros de localização para `google_shopping_product` e `google_shopping_search` fontes, certifique-se de usar os mesmos locales (nenhum, se não definido). O desalinhamento regional entre as fontes pode resultar em dados incompletos ou imprecisos.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.oxylabs.io/api-targets/pt-br/search-engines/google/shopping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
