> ## Documentation Index
> Fetch the complete documentation index at: https://docs.proxyscrape.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Run a Google search and receive parsed results as JSON. Authenticate with HTTP Basic Auth using a SERP API sub-user's `username` and `password` (create and manage sub-users in the dashboard).



## OpenAPI

````yaml /openapi-serp.json get /
openapi: 3.0.3
info:
  title: ProxyScrape SERP API
  description: >-
    SERP API — query Google search results as structured JSON. Authenticate with
    HTTP Basic Auth using a SERP API sub-user's username and password.
  version: 1.0.0
servers:
  - url: https://serp.api.proxyscrape.com
    description: ProxyScrape SERP API
security:
  - basicAuth: []
tags:
  - name: SERP API
    description: Run Google searches and receive parsed results as JSON.
paths:
  /:
    get:
      tags:
        - SERP API
      summary: Search
      description: >-
        Run a Google search and receive parsed results as JSON. Authenticate
        with HTTP Basic Auth using a SERP API sub-user's `username` and
        `password` (create and manage sub-users in the dashboard).
      operationId: search
      parameters:
        - name: q
          in: query
          required: true
          description: The search query. URL-encode it.
          schema:
            type: string
          example: proxyscrape
        - name: gl
          in: query
          required: false
          description: >-
            Two-letter country code for the search location (Google `gl`), e.g.
            `us`, `de`, `fr`.
          schema:
            type: string
            default: us
          example: us
        - name: hl
          in: query
          required: false
          description: Two-letter interface language code (Google `hl`), e.g. `en`, `es`.
          schema:
            type: string
            default: en
          example: en
        - name: start
          in: query
          required: false
          description: >-
            Result offset for pagination. `0` is the first page, `10` the
            second, and so on.
          schema:
            type: integer
            minimum: 0
            default: 0
          example: 0
        - name: rawhtml
          in: query
          required: false
          description: >-
            Set to `1` to also return the raw HTML of the results page in the
            `html` field. `0` omits it.
          schema:
            type: integer
            enum:
              - 0
              - 1
            default: 0
          example: 0
      responses:
        '200':
          description: >-
            Parsed search results. Organic results are under
            `results[0].Organic`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  query:
                    type: string
                    description: The query that was executed.
                  url:
                    type: string
                    description: The Google search URL the request resolved to.
                  html:
                    type: string
                    description: >-
                      Raw HTML of the results page. Populated only when
                      `rawhtml=1`.
                  results:
                    type: array
                    description: Single-element array holding the parsed result groups.
                    items:
                      type: object
                      description: >-
                        A group of results. The groups present vary by query —
                        `Organic` and `PeopleAlsoSearchFor` are the most common,
                        but others such as `Places` may also appear, and this
                        set is not exhaustive.
                      properties:
                        Organic:
                          type: array
                          description: Organic search results, ordered by rank.
                          items:
                            $ref: '#/components/schemas/SerpResultItem'
                        PeopleAlsoSearchFor:
                          type: array
                          description: Related "people also search for" suggestions.
                          items:
                            $ref: '#/components/schemas/SerpResultItem'
                        Places:
                          type: array
                          description: >-
                            Local business / map-pack results, when the query
                            triggers them.
                          items:
                            $ref: '#/components/schemas/SerpResultItem'
              example:
                query: proxyscrape
                url: >-
                  https://www.google.com/search?q=proxyscrape&num=10&start=0&hl=en
                html: ''
                results:
                  - Organic:
                      - title: ProxyScrape - Free Proxy List & Premium Proxies
                        url: https://proxyscrape.com/
                        description: >-
                          ProxyScrape provides free proxy lists and premium
                          proxy services...
                        moreinfo: ''
                        rank: 0
                    PeopleAlsoSearchFor:
                      - title: proxyscrape free proxy
                        url: https://www.google.com/search?q=proxyscrape+free+proxy
                        description: ''
                        moreinfo: ''
                        rank: 0
                    Places:
                      - title: Example Proxy Co.
                        url: ''
                        description: 5.0(12) · Software company
                        moreinfo: ''
                        rank: 0
        '401':
          description: Missing or invalid Basic Auth credentials.
      security:
        - basicAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl
            "https://serp.api.proxyscrape.com/?q=proxyscrape&gl=us&hl=en&start=0&rawhtml=0"
            \
              -u "<sub-user-username>:<sub-user-password>"
        - lang: javascript
          label: NodeJS
          source: |-
            const axios = require('axios');

            const username = '<sub-user-username>';
            const password = '<sub-user-password>';
            const host = 'https://serp.api.proxyscrape.com';

            const url = host + '?q=proxyscrape&gl=us&hl=en&start=0&rawhtml=0';

            axios
              .get(url, { auth: { username, password } })
              .then((res) => console.log(res.data.results[0]))
              .catch((err) => console.error(err));
        - lang: python
          label: Python3
          source: |-
            #!/usr/bin/env python3
            import requests

            username = "<sub-user-username>"
            password = "<sub-user-password>"
            host = "https://serp.api.proxyscrape.com"

            url = host + "?q=proxyscrape&gl=us&hl=en&start=0&rawhtml=0"
            headers = {"User-Agent": "curl/8.7.1"}

            r = requests.get(url, auth=(username, password), headers=headers)
            print(r.text)
components:
  schemas:
    SerpResultItem:
      type: object
      properties:
        title:
          type: string
          description: The result title.
        url:
          type: string
          description: The result URL.
        description:
          type: string
          description: The result snippet / description.
        moreinfo:
          type: string
          description: >-
            Additional metadata Google attaches to the result, when present.
            Often an empty string.
        rank:
          type: integer
          description: The result's position within its group.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Auth using a SERP API sub-user's username and password.

````