urlstringจำเป็น
Public URL of the image to search with.
https://api.sandbase.ai/v1/api/google/lensReverse image search: find web pages and visual matches for an image URL.
PNG, JPEG, WebP หรือ GIF · สูงสุด 20 MiB
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
The Google Lens API runs a reverse image search on a public image URL. It returns a list of web pages and visual matches, each with a title, source site, link and image. The only input is the url of the image.
curl -X POST "https://api.sandbase.ai/v1/api/google/lens" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://i.imgur.com/HBrB8p0.png"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Public URL of the image to search with. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"results": [
{
"image": "https://preview.redd.it/arnold-schwarzenegger-and-danny-devito-v0-mnja7ruli9dh1.…",
"link": "https://www.reddit.com/r/CelebrityLookalikes/comments/1uwlrps/arnold_schwarzeneg…",
"source": "Reddit",
"thumbnailUrl": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQd3AyHbyvFtdWZ50GZr6_g7e9I…",
"title": "Arnold Schwarzenegger und Danny DeVito : r/CelebrityLookalikes"
}
],
"url": "https://i.imgur.com/HBrB8p0.png"
},
"found": true
}
| Field | Meaning |
|---|---|
found | true when the search returned matches. The request still succeeds when nothing is found, and found is false in that case. |
data.url | The image URL that was searched, echoed back from the request. |
data.results[].title | Title of the matching web page or post. |
data.results[].link | URL of the web page that contains the matching image. |
data.results[].source | Name of the site that hosts the match, such as Reddit or Facebook. |
data.results[].image | URL of the matching image on the source site. Some values are cut or point to a resized preview. |
data.results[].thumbnailUrl | URL of a small thumbnail of the match. |
url must point to a public image. Pages that need a login will not work.url. It has no pagination parameters.Billed at the actual cost of each call, about $0.00085 for the request above. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/google/lens" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://i.imgur.com/HBrB8p0.png"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
urlstringจำเป็นPublic URL of the image to search with.
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Google LensAPI นี้ Google | เริ่มต้นที่ $0.00085 ต่อครั้ง | JSON |
Google | $0.01 ต่อการเรียก | JSON |
Google | $0.015 ต่อการเรียก | JSON |
Google | เริ่มต้นที่ $0.002 ต่อครั้ง | JSON |
Google | เริ่มต้นที่ $0.0015 ต่อครั้ง | JSON |
Google | $0.01 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/google/lens โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
เริ่มต้นที่ $0.00085 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: url (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Google Lens ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Google API แยกต่างหาก