Locate API (POST /v1/locate)
POSThttps://llm.manina.ai/v1/locate
Finds the single on-screen UI element described by a plain-language instruction in an iPhone or Android screenshot. It returns the tap point and bounding box in the integer pixel coordinates of the image you sent, a boolean indicating whether the element is currently on screen, and presence/box confidence scores. When on_screen is false, point and box remain the model’s best guess, do not tap them; scroll, navigate back, or rephrase instead. Every HTTP 200 answer is billed at a flat rate ($0.0003 per call), while errors are never billed.
AI Agent & CLI shortcut: Point Claude Code, Codex, or Cursor at manina.ai/llms-full.txt to generate client code automatically, or run manina find “Settings app icon” –tap from your terminal with npm i -g manina.
Request
Section titled “Request”import base64import jsonimport osimport urllib.request
with open("screenshot.png", "rb") as f: image_b64 = base64.b64encode(f.read()).decode("ascii")
req = urllib.request.Request( "https://llm.manina.ai/v1/locate", data=json.dumps({ "image": image_b64, "text": "Settings app icon", "min_present": 0.5, }).encode("utf-8"), headers={ "Authorization": f"Bearer {os.environ['MANINA_API_KEY']}", "Content-Type": "application/json", }, method="POST",)
with urllib.request.urlopen(req) as resp: result = json.loads(resp.read().decode("utf-8"))
if result["on_screen"]: print("Tap pixel:", result["point"], "box:", result["box"])import { readFileSync } from 'node:fs';
const response = await fetch('https://llm.manina.ai/v1/locate', { method: 'POST', headers: { Authorization: `Bearer ${process.env.MANINA_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ image: readFileSync('screenshot.png').toString('base64'), text: 'Settings app icon', min_present: 0.5, }),});
const result = await response.json();if (result.on_screen) { console.log('Tap pixel:', result.point, 'box:', result.box);}( printf '{"text":"Settings app icon","image":"' base64 < screenshot.png | tr -d '\n' printf '"}') | curl -sS https://llm.manina.ai/v1/locate \ -H "Authorization: Bearer $MANINA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @-Parameters
Section titled “Parameters”Headers
Section titled “Headers”| Name | Type | Required | Description |
|---|---|---|---|
Authorization |
string | yes | Bearer hsk_live_… in production, or Bearer hsk_test_… in Sandbox. Create keys in your account (API keys →). |
Content-Type |
string | yes | Must be application/json. Maximum request body size is 12 MB. |
Body (JSON)
Section titled “Body (JSON)”Unknown JSON fields are rejected with 400 invalid_request.
| Name | Type | Required | Description |
|---|---|---|---|
image |
string | yes | Base64-encoded screenshot in PNG, JPEG, or WebP format. A data:image/png;base64, (or jpeg / webp) prefix and whitespace/newlines are accepted and stripped automatically. Any dimensions up to ~89 megapixels. |
text |
string | yes | Plain-language description of the single element to locate, 1 to 1,000 characters after trimming whitespace. Any language (for example "Settings app icon" or "登录按钮"). |
min_present |
number | no | Threshold between 0 and 1 (inclusive), default 0.5. on_screen is true only when both present_prob >= min_present and confidence >= min_present. Raise it when a wrong tap is costly. |
Response
Section titled “Response”{ "id": "loc_2f7c9a1e0b6d4f3a", "point": {"x": 1203, "y": 330}, "box": [1112, 266, 1294, 394], "on_screen": true, "present_prob": 0.998, "confidence": 0.93, "image": {"width": 1320, "height": 2868}, "latency_ms": 268, "model": "manina-locate-1"}Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
id |
string | Unique request identifier (loc_ followed by 16 lowercase hex characters). Include this when contacting support. |
point |
object | {"x": integer, "y": integer}: centre of box in the pixels of your uploaded image. Tap here when on_screen is true. |
box |
integer[4] | [x1, y1, x2, y2] bounding box in the integer pixels of your uploaded image, clamped within [0, width] and [0, height]. |
on_screen |
boolean | true when present_prob >= min_present and confidence >= min_present; false when the target is absent, occluded, or ambiguous. |
present_prob |
number | 0 to 1: model score for whether the requested element appears anywhere on this screen. |
confidence |
number | 0 to 1: spatial sharpness/certainty score for box. Useful as a ranking signal across candidate instructions, not a calibrated probability. |
image |
object | {"width": integer, "height": integer} of your uploaded screenshot after decoding. |
latency_ms |
integer | Server processing time in milliseconds from receiving the request to sending the response (excluding network round-trip). |
model |
string | Model identifier that answered the call. Enum values: "manina-locate-1". |
Interpreting scores & coordinates
Section titled “Interpreting scores & coordinates”- Gate every tap on
on_screen: Never tappointwhenon_screenisfalse. Scroll the view, wait for loading to finish, or ask your planner for an alternative action. - Tune
min_presentfor high-stakes screens: Raisingmin_presentfrom0.5to0.7or0.8requires stronger agreement between presence detection (present_prob) and box localization (confidence). - Errors & retry handling: See Error codes & rate limits for
400,401,402, and503 busy(Retry-After: 1) responses.
