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

# Google patents API

> Search Google Patents by words, inventor, assignee, office, dates and status. Call the Google patents API for JSON. 1 credit per call.

Searches Google Patents by words, inventor, assignee, office, dates and status.

## Request

This method has no required parameters.

<CodeGroup>
  ```typescript TypeScript icon="https://mintlify.s3.us-west-1.amazonaws.com/sirathic/images/icons/typescript.svg" theme={null} theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.patents({ query: "solid state battery" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null} theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.patents(query="solid state battery")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null} theme={null}
  curl -X POST https://api.stophy.dev/v1/google/patents \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"solid state battery"}'
  ```

  ```bash CLI icon="square-terminal" theme={null} theme={null}
  stophy google patents "solid state battery"
  ```
</CodeGroup>

## Response

If successful, the response body contains the standard envelope. `data.results[]` contains the patents, each with its owner, inventor, dates and link.

The following example is a real response, truncated: each list shows one item and long strings are cut.

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "patentId": "WO2013104046A1",
        "title": "A system and method for assuring operational readiness of a mission critical …",
        "snippet": "A SYSTEM AND METHOD FOR ASSURING OPERATIONAL READINESS OF A MISSION CRITICAL BATTERY HAVING A LONG STORAGE PERIOD…",
        "assignee": "Panacis Inc.",
        "inventor": "Steve Carkner",
        "priorityDate": "2012-01-09",
        "filingDate": "2012-12-19",
        "publicationDate": "2013-07-18",
        "language": "en",
        "patentUrl": "https://patents.google.com/patent/WO2013104046A1/en",
        "pdfUrl": "https://patentimages.storage.googleapis.com/4f/16/c5/b5bc207e6ec556/WO2013104046A1.pdf",
        "thumbnailUrl": "https://patentimages.storage.googleapis.com/c6/b7/47/f2e1e172e74da8/pctca2012050916-appb-P000004-000001.png",
        "position": 1
      }
    ],
    "page": 1
  },
  "creditsUsed": 1,
  "requestId": "2fe9dbad-fc48-4890-9751-0b24b596035b"
}
```

| Field | Type | Description |
| - | - | - |
| `patentId` | string | Publication number, such as US11993294B2. |
| `page` | integer | The page number of this response. |
| `position` | integer | The 1-based position of the result in the list. |

For every field, see the response schema on this page.

## Optional parameters

| Parameter | Type | Description |
| - | - | - |
| `query` | string | Words to search for. |
| `inventor` | string | Restricts results to patents by this inventor. |
| `assignee` | string | Restricts results to patents owned by this company or person. |
| `office` | string | Patent office, such as `US`, `EP`, `WO`, `CN` or `JP`. |
| `language` | string | The language of the patents. Accepts one of 16 values, such as `english`, `german` and `chinese`. |
| `dateType` | string | Specifies the date that `before` and `after` are compared against. Acceptable values are `priority`, `filing` and `publication`. If unset, defaults to `priority`. |
| `after` | string (date) | Restricts results to patents dated after this day. `dateType` picks which date counts. Format: `YYYY-MM-DD`. |
| `before` | string (date) | Restricts results to patents dated before this day. `dateType` picks which date counts. Format: `YYYY-MM-DD`. |
| `status` | string | Granted patents or applications. Acceptable values are `grant` and `application`. |
| `type` | string | Patents or designs. Acceptable values are `patent` and `design`. |
| `litigation` | string | Restricts results to patents with related litigation (`has`), or with none known (`none`). Acceptable values are `has` and `none`. |
| `sort` | string | Specifies the order of the patents. Acceptable values are `relevance`, `newest` and `oldest`. If unset, defaults to `relevance`. |
| `page` | integer | The page to return. Pages are numbered from 1. Must be between 1 and 100. If unset, defaults to `1`. |

## Billing

Each successful request consumes 1 credit, regardless of the number of items returned. Requests that fail, or that return no items, are not billed.

## Pagination

Results are paginated. To retrieve the next page, increment `page`. An empty `data.results` indicates the last page. The maximum value of `page` is 100.

## Related methods

* [Google Patents](/api-reference/endpoint/google-patents): Accepts an `assignee` or `inventor` from `results`. Searches Google Patents by words, inventor, assignee, office, dates and status.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/google/patents
openapi: 3.1.0
info:
  title: Stophy API
  version: '1'
  description: >-
    Every endpoint is a POST that takes its input as a JSON object body. Unknown
    fields are rejected with 400.


    Responses leave out empty values: null, empty strings, empty objects and
    empty nested lists are not sent.


    x-credits is what one call costs. Every call costs the same, whatever it
    returns, unless an operation's description says it costs per 10 results, or
    per second of audio. Then x-credits is the lowest price and x-credits-max
    the most one call can cost. Where an operation takes limit, send it to
    return fewer results and pay for fewer.


    When a response has a cursor, send it back unchanged with the same input to
    get the next page. When it has a page, send the next page number.
servers:
  - url: https://api.stophy.dev
security:
  - apiKey: []
paths:
  /v1/google/patents:
    post:
      summary: >-
        Search Google Patents by words, inventor, assignee, office, dates and
        status
      description: Costs 1 credit per call. Pages with page.
      operationId: googlePatents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  minLength: 1
                  maxLength: 500
                inventor:
                  type: string
                  minLength: 1
                  maxLength: 200
                assignee:
                  type: string
                  minLength: 1
                  maxLength: 200
                office:
                  description: >-
                    Google Patents' own Patent office, like US, EP, WO, CN or
                    JP.
                  type: string
                  pattern: ^[A-Za-z]{2}$
                language:
                  type: string
                  enum:
                    - english
                    - german
                    - chinese
                    - french
                    - spanish
                    - arabic
                    - japanese
                    - korean
                    - portuguese
                    - russian
                    - italian
                    - dutch
                    - swedish
                    - finnish
                    - norwegian
                    - danish
                dateType:
                  default: priority
                  description: >-
                    Which date before and after compare: Google Patents' own
                    date choice.
                  type: string
                  enum:
                    - priority
                    - filing
                    - publication
                after:
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                before:
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                status:
                  type: string
                  enum:
                    - grant
                    - application
                type:
                  type: string
                  enum:
                    - patent
                    - design
                litigation:
                  description: >-
                    Google Patents' own Litigation: has related litigation, or
                    no known.
                  type: string
                  enum:
                    - has
                    - none
                sort:
                  default: relevance
                  type: string
                  enum:
                    - relevance
                    - newest
                    - oldest
                page:
                  default: 1
                  description: Page number, starting at 1.
                  type: integer
                  minimum: 1
                  maximum: 100
              additionalProperties: false
            example:
              query: solid state battery
      responses:
        '200':
          description: The data, and the credits this call used.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            x-credits-used:
              $ref: '#/components/headers/CreditsUsed'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            x-cache:
              $ref: '#/components/headers/Cache'
            x-cache-age:
              $ref: '#/components/headers/CacheAge'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - creditsUsed
                  - requestId
                properties:
                  success:
                    const: true
                  data:
                    type: object
                    additionalProperties: false
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          additionalProperties: false
                          properties:
                            patentId:
                              type: string
                              minLength: 1
                              description: Publication number, like US11993294B2.
                            title:
                              type: string
                              minLength: 1
                            snippet:
                              type: string
                            assignee:
                              type: string
                            inventor:
                              type: string
                            priorityDate:
                              type: string
                              format: date
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                            filingDate:
                              type: string
                              format: date
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                            grantDate:
                              type: string
                              format: date
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                            publicationDate:
                              type: string
                              format: date
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                            language:
                              type: string
                            patentUrl:
                              type: string
                              format: uri
                            pdfUrl:
                              type: string
                              format: uri
                            thumbnailUrl:
                              type: string
                              format: uri
                            position:
                              type: integer
                              exclusiveMinimum: 0
                              maximum: 9007199254740991
                          required:
                            - patentId
                            - title
                            - patentUrl
                            - position
                      page:
                        type: integer
                        minimum: 1
                        maximum: 9007199254740991
                    required:
                      - results
                      - page
                  creditsUsed:
                    type: integer
                  requestId:
                    type: string
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
components:
  headers:
    RequestId:
      description: The request id. Quote it when you report a problem.
      schema:
        type: string
    CreditsUsed:
      description: Credits this call used.
      schema:
        type: integer
    RateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    RateLimitRemaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimitReset:
      description: Unix time in seconds when the current window resets.
      schema:
        type: integer
    Cache:
      description: hit if this result came from the cache, miss if it was fetched live.
      schema:
        type: string
    CacheAge:
      description: Seconds since the returned result was written to the cache.
      schema:
        type: integer
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    Error:
      description: The request failed. retryable says whether trying again can help.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          const: false
        error:
          type: object
          required:
            - code
            - message
            - retryable
            - requestId
          properties:
            code:
              type: string
              enum:
                - cliSessionCompleted
                - cliSessionExists
                - cliSessionNotFound
                - forbidden
                - insufficientCredits
                - internalError
                - inviteClaimed
                - inviteDisabled
                - inviteExpired
                - inviteUsedUp
                - invalidCliSession
                - invalidCliVerifier
                - invalidRequest
                - notFound
                - rateLimited
                - sourceChanged
                - sourceRefused
                - sourceTimeout
                - sourceUnavailable
                - tooManyInFlight
                - unauthorized
                - unsupportedMediaType
            message:
              type: string
            retryable:
              type: boolean
            retryAfterSeconds:
              type: integer
            requestId:
              type: string
            requiredCredits:
              type: number
            availableCredits:
              type: number
            billingUrl:
              type: string
              const: https://stophy.dev/billing
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.