谷歌反向图片搜索API
使用谷歌反向图片搜索,查找某张图片在网络上出现的位置。设置 engine=google_reverse_image,并在 image_url 参数中传入一个可公开访问的图片 URL。
Endpoint
Section titled “Endpoint” GET https://serp.shifter.io/v1?engine=google_reverse_image&api_key=YOUR_API_KEY
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | 您的 SERP API 密钥 |
engine | string | yes | 必须为 google_reverse_image |
image_url | string | yes | 要搜索的图片的 URL(必须经过 URL 编码) |
device | string | no | desktop、mobile 或 tablet |
google_domain | string | no | 要使用的谷歌域名 |
location | string | no | 地理定位位置名称 |
uule | string | no | 谷歌编码的位置字符串 |
hl | string | no | 界面语言代码 |
gl | string | no | 国家代码 |
lr | string | no | 语言限制,格式为 lang_xx |
Example request
Section titled “Example request”curl "https://serp.shifter.io/v1?engine=google_reverse_image&api_key=YOUR_API_KEY&image_url=https%3A%2F%2Fencrypted-tbn1.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcRjlJi4t9H9nOiAAv_nRGq8arI_Ed9ILW1lY9lKWa63q8AL_UwI"import requests
params = { "engine": "google_reverse_image", "api_key": "YOUR_API_KEY", "image_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRjlJi4t9H9nOiAAv_nRGq8arI_Ed9ILW1lY9lKWa63q8AL_UwI",}r = requests.get("https://serp.shifter.io/v1", params=params)data = r.json()import fetch from 'node-fetch';
const url = 'https://serp.shifter.io/v1?' + new URLSearchParams({ engine: 'google_reverse_image', api_key: 'YOUR_API_KEY', image_url: 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRjlJi4t9H9nOiAAv_nRGq8arI_Ed9ILW1lY9lKWa63q8AL_UwI',});const data = await (await fetch(url)).json();Example response
Section titled “Example response”{ "search_parameters": { "engine": "google_reverse_image", "image_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:..." }, "image_sizes": [ { "size": "1920 x 1080", "image": "https://...", "link": "https://..." } ], "inline_images": [ { "source": "https://example.com", "thumbnail": "https://..." } ], "image_results": [ { "position": 1, "title": "Image from example.com", "link": "https://example.com/page", "source": "example.com", "thumbnail": "https://..." } ]}