Primitives
Resolve a description to exact coordinates
Grounding
Grounding, at a glance
Resolve a description to exact coordinates
POST /v1/groundRequest map4 boundaries
- 01Screencurrent pixels
- 02Describeone target element
- 03Locateresolve x and y
- 04Checkvalidate before click
Grounding answers a narrower question than predict: “where is this element?” Give it a screenshot and a description and it returns the exact x, y coordinate to target. It is faster and cheaper than a full prediction ($0.03 instead of the $0.05 Predict base price), which makes it ideal when you already know what to do and only need a pixel to click.
import os, requests
res = requests.post(
"https://coasty.ai/v1/ground",
headers={"X-API-Key": os.environ["COASTY_API_KEY"]},
json={
"screenshot": screenshot, # base64 PNG (see Predict)
"element": "the blue Submit button below the form",
},
timeout=60,
).json()
print(res["x"], res["y"]) # exact click coordinatesThe response is { x, y, usage, request_id }. Coordinates are in the same pixel space as the screenshot you sent.