Tap and Hold by Description
curl --request POST \
--url https://api.example.com/v1/phones/{phone_id}/tap-and-hold/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTap and Hold by Description
Long press an element using natural language description
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/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/tap-and-hold/select")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyLong 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: joot_your_api_key" \
-H "Content-Type: application/json" \
-d '{"selector": "the app icon to delete", "duration_ms": 1000}'
Path Parameters
| Parameter | Type | Description |
|---|---|---|
phone_id | string | The phone identifier |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
async | boolean | false | Return immediately with job ID |
Request Body
{
"selector": "the app icon to delete",
"duration_ms": 1000
}
| Field | Type | Default | Description |
|---|---|---|---|
selector | string | required | Natural language description of the element to hold |
duration_ms | integer | 1000 | How 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: joot_..." \
-H "Content-Type: application/json" \
-d '{"selector": "the Instagram app icon", "duration_ms": 2000}'
SDK Usage
The Python SDK provides this through thehold() 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")
Related Endpoints
- Tap and Hold - Long press at specific coordinates
- Tap by Description - Single tap using natural language
⌘I