Skip to main content
POST
/
v1
/
phones
/
{phone_id}
/
tap-and-hold
/
select
Tap and Hold by Description
curl --request POST \
  --url https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select
Long press an element on screen by describing it in natural language. Uses vision AI to find and hold the described element.

Request

curl -X POST https://api.tapkit.ai/v1/phones/{phone_id}/tap-and-hold/select \
  -H "X-API-Key: TK_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"selector": "the app icon to delete", "duration_ms": 1000}'

Path Parameters

ParameterTypeDescription
phone_idstringThe phone identifier

Query Parameters

ParameterTypeDefaultDescription
asyncbooleanfalseReturn immediately with job ID

Request Body

{
  "selector": "the app icon to delete",
  "duration_ms": 1000
}
FieldTypeDefaultDescription
selectorstringrequiredNatural language description of the element to hold
duration_msinteger1000How long to hold in milliseconds

Response

Synchronous

{
  "id": "job_abc123",
  "status": "completed",
  "result": {},
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:02Z"
}

Asynchronous

{
  "job_id": "job_abc123"
}

Examples

Hold to Delete App

curl -X POST https://api.tapkit.ai/v1/phones/abc123/tap-and-hold/select \
  -H "X-API-Key: TK_..." \
  -H "Content-Type: application/json" \
  -d '{"selector": "the Instagram app icon", "duration_ms": 2000}'

SDK Usage

The Python SDK provides this through the hold() method with a string argument:
phone.hold("the app icon to delete")
phone.hold("the message to get options", duration_ms=1500)
phone.hold("the link to preview")