Pinch by Description
curl --request POST \
--url https://api.example.com/v1/phones/{phone_id}/pinch/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/pinch/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/pinch/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}/pinch/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}/pinch/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}/pinch/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/pinch/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_bodyPinch by Description
Pinch/zoom on an element using natural language description
POST
/
v1
/
phones
/
{phone_id}
/
pinch
/
select
Pinch by Description
curl --request POST \
--url https://api.example.com/v1/phones/{phone_id}/pinch/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/pinch/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/pinch/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}/pinch/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}/pinch/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}/pinch/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/pinch/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_bodyPinch, zoom, or rotate on an element described in natural language. Uses vision AI to find the element and perform the gesture.
Request
curl -X POST https://api.tapkit.ai/v1/phones/{phone_id}/pinch/select \
-H "X-API-Key: joot_your_api_key" \
-H "Content-Type: application/json" \
-d '{"selector": "the map", "action": "pinch_out", "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 map",
"action": "pinch_out",
"duration_ms": 1000
}
| Field | Type | Default | Description |
|---|---|---|---|
selector | string | required | Natural language description of the element |
action | string | required | "pinch_in", "pinch_out", "rotate_cw", or "rotate_ccw" |
duration_ms | integer | 1000 | Gesture duration in milliseconds |
Actions
| Action | Effect |
|---|---|
pinch_out | Zoom in (fingers apart) |
pinch_in | Zoom out (fingers together) |
rotate_cw | Rotate clockwise |
rotate_ccw | Rotate counter-clockwise |
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
Zoom In on a Map
curl -X POST https://api.tapkit.ai/v1/phones/abc123/pinch/select \
-H "X-API-Key: joot_..." \
-H "Content-Type: application/json" \
-d '{"selector": "the map view", "action": "pinch_out", "duration_ms": 1000}'
SDK Usage
The Python SDK provides this through thepinch() method with a string argument:
phone.pinch("the map", "pinch_out") # Zoom in
phone.pinch("the photo", "pinch_in", duration_ms=1500) # Zoom out
phone.pinch("the image", "rotate_cw") # Rotate clockwise
Related Endpoints
- Pinch - Pinch at specific coordinates
- Double Tap - Alternative zoom method
⌘I