Read one screen of an app
Opens an app, follows an app:// address to a screen, and returns
that screen as a document. The task is a session: the id is the
session id, so GET /v1/scrape/{id} answers its status and document.
It is mechanical: fixed rules follow the address (open the app, tap
the row each path part names, confirm the screen moved on), and no
model chooses a target. A path part the screen does not carry fails
the task with that step named, rather than guessing or reading a
different screen. Only the {type: "json", schema} format asks a
model to read fields off the screen.
The phone is the workspace’s only phone when it has one. A workspace
with several phones passes device; without it the request is a
400 that lists the ids to choose from. A task holds its phone for
its duration. A phone already running another task queues this one:
it reads processing and starts when the phone frees, and its document’s
metadata then reports concurrencyLimited and
concurrencyQueueDurationMs. A task still waiting after 15 minutes
fails with queue_expired without starting, and nothing is charged.
Phone time is charged as it is for a run.
curl --request POST \
--url https://api.lusor.ai/v1/scrape \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"url": "<string>",
"formats": [],
"maxScreens": 25,
"device": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 31
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
formats: [],
maxScreens: 25,
device: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expiresIn: 31
})
};
fetch('https://api.lusor.ai/v1/scrape', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/scrape"
payload = {
"url": "<string>",
"formats": [],
"maxScreens": 25,
"device": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 31
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"liveViewUrl": "<string>"
}{
"error": "device_required",
"message": "<string>",
"devices": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "device_busy",
"currentSessionId": "<string>",
"message": "<string>"
}Authorizations
Headers
Body
The screen's address: app://<app>/<path>, the host a Lusor app
name (settings) or a raw package / bundle id
(com.apple.Preferences), the path each screen's name in lowercase
with dashes (app://settings/general/about). Only app://
addresses are followed today: any other address, a deep link or
a web link included, is a 400 bad_request.
2048What to return. Defaults to ["markdown"]. Supported in this
step: markdown, screenshot (or {type: "screenshot", fullPage: true}), and {type: "json", schema}; anything else
is a 400 unsupported_format.
16- Option 1 · enum<string>
- Option 2 · object
- Option 3 · object
markdown, screenshot Response
Task accepted
Was this page helpful?
curl --request POST \
--url https://api.lusor.ai/v1/scrape \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"url": "<string>",
"formats": [],
"maxScreens": 25,
"device": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 31
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
formats: [],
maxScreens: 25,
device: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expiresIn: 31
})
};
fetch('https://api.lusor.ai/v1/scrape', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/scrape"
payload = {
"url": "<string>",
"formats": [],
"maxScreens": 25,
"device": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresIn": 31
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"liveViewUrl": "<string>"
}{
"error": "device_required",
"message": "<string>",
"devices": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "device_busy",
"currentSessionId": "<string>",
"message": "<string>"
}
