---
title: "Google Lens API: Upload | Perceptlayer"
description: "Upload from Google Lens as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/google-lens/upload
---

[APIs](https://perceptlayer.com/apis) / [Google Lens](https://perceptlayer.com/apis/google-lens) / Upload

# Google Lens: Upload

Upload from Google Lens as JSON. 1 credit per successful call.

POST `/v1/google-lens/upload`

## Parameters

Send parameters in the JSON body.

Required Send `image` or `image_base64`.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `image` | file | Optional | Any The image file, sent as multipart/form-data: JPEG, PNG, WebP, GIF or AVIF, up to 10 MB. Send \`image\` or \`image\_base64\`, not both. |
| `image_base64` | string | Optional | Any The image as base64 text, or a data:image/...;base64, URI, in a JSON or form body. Send \`image\` or \`image\_base64\`, not both. |
| `q` | string | Optional | Any |
| `type` | string | Optional | all, products, exact\_matches, visual\_matches |

## Example request

Google Lens

POST /v1/google-lens/upload 

```
{
  "search_parameters": {
    "image": "upload",
    "type": "visual_matches"
  },
  "visual_matches": [
    {
      "source": "google.com",
      "title": "DOSE Antwerp | Antwerp",
      "link": "https://www.google.com/goto?url=CAESYwHEIkXXsGpwzZ1uoiv7FYiVHN8qhbrINk9oz6ZMOtX0oBBQKqepe4uVAiloQL5lWFIPIQd2RdMaPNiLDKzJiWRj3STxpVY7iHRDRJipvqNKGg29o81cJeMoQV_1MzOOooGaLA&gsessionid=resNfwwqNPy8V9XAv02vuUTC_cDy6AIeZb9ZUZPo6lxZrDU5U0oqpw",
      "position": 1
    },
    {
      "source": "google.com",
      "title": "5 things to consider when buying a café - Hilton Smythe",
      "link": "https://www.google.com/goto?url=CAESfgHEIkXX-MjNvbE-34gO9o-Mu0N9gUBYKaS2xBYCt--Vpx0ii8eHaMvFhZBWdamIQuKOZNSp2k05WN02iBJ99Hndae3PXD3DxU6JulcZ2U8zH-mWSISezbwcjaTE5ohk05ZeR9ThwbcrlPjV2TiUs1DGNCynjD9hSDOP_8lzVw&gsessionid=resNfwwqNPy8V9XAv02vuU…",
      "position": 2
    },
    {
      "source": "google.com",
      "title": "BSA Level 1 in Barista Skills – Kimbo UK Ltd",
      "link": "https://www.google.com/goto?url=CAESewHEIkXX47IYtH0k4AkHp6b-BBKCBZhIUEdrIkNg2V8Wgd7a3b-iyB-hSkbjX_KBi8ALkCSi7TDxCovLUEa4J6TIxd7IldAHFfvD3kbi8hdbCKCgKF3yancxgVs_23F9UZGBwu8mzJctil_E6iWrYXEAJ0q66DJMdkIUKg&gsessionid=resNfwwqNPy8V9XAv02vuUTC_c…",
      "position": 3
    }
  ]
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

[Run this endpoint in the playground](https://perceptlayer.com/apis/google-lens?try=upload#playground) with your own parameters. 1 credit per successful call; failed calls are free.

## Response fields

Each item in `visual_matches` has these 4 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

| Field | Type |
| --- | --- |
| `source` | string |
| `title` | string |
| `link` | url |
| `position` | integer |
