MapUpdated 6 min read
Introducing map: list the known screens of a phone app as links
Lusor's map call lists the screens Lusor already knows in a phone app, as app:// addresses that scrape can follow. It answers at once and never opens the app. Here is what it returns, where the links come from, and why a map is never complete.
By Josiah Richards
TL;DR
- POST /v1/map lists the screens Lusor knows in a phone app as app:// addresses, each with a title, that Lusor's scrape call can follow.
- Map answers at once. It never opens the app, holds no phone and runs no model, so it is not a task and there is nothing to poll.
- Links come from your workspace's own scrape and agent runs, which record the screens they pass through, plus a base map Lusor ships of English iPhone Settings.
- coverage counts the links from each source, checkedAt says when a run last read the app, and an empty list carries a message. A map is never claimed to be complete.
- search ranks links by name and address, limit returns at most 5000, a path in the url keeps only the links under it, and device picks the platform whose map to read.
Lusor's scrape call reads a phone app screen from an app:// address. To use it, you need the address. Map lists the addresses Lusor already knows for an app, with the name of each screen, so you can pick one and scrape it.
Lusor's app-data API is modeled on Firecrawl's, so map takes a url, a search and a limit and returns links. The map docs have every field.
How do you map an app?
Send the app as an app:// address to POST /v1/map.
curl "https://api.lusor.ai/v1/map" \
-H "X-Api-Key: $LUSOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "app://settings",
"search": "about",
"limit": 50
}'{
"success": true,
"links": [
{ "url": "app://settings/general/about", "title": "About" }
],
"coverage": { "recorded": 0, "base": 1 },
"checkedAt": null
}| What it is | |
|---|---|
| links | The known screens. Each has url, an address scrape can follow, and title, the screen's name as a person sees it. |
| coverage.recorded | How many links came from your workspace's own runs. |
| coverage.base | How many links came from Lusor's base map. |
| checkedAt | When a run in your workspace last read one of the app's mapped screens. null when nothing of the app is recorded. |
| message | Present when links is empty. It says why. |
Without search, the app's first screen comes first. Map is not a task. It never opens the app, holds no phone and runs no model, so the response is the result, with no id to read later and nothing to poll.
Where do the links come from?
From two places, and coverage counts each.
- Your runs. Every scrape and agent run in your workspace records the screens it passes through and the rows it taps, so the map grows as you use the app. Each address is the shortest chain of tapped row names from the app's first screen, in lowercase with dashes, so scrape can follow it as written. Back buttons are never steps.
- Lusor's base map. Addresses scrape has completed on a real phone. Today that is English iPhone Settings:
general,general/about,battery,wi-fiandprivacy-&-security.
A map is never claimed to be complete. It lists what runs have seen. checkedAt says when a run in your workspace last read one of the app's mapped screens, and it is null when nothing of the app is recorded.
Which phone's map does it read?
Screen names differ between iPhone and Android, so a recorded map is per platform. Map reads:
- the platform of the phone named in
device, when you send it; - otherwise the platform all of the workspace's phones share;
- otherwise both platforms, when the workspace has phones of both kinds or none.
A Lusor app name such as app://settings is the app on either platform. A raw package or bundle id such as app://com.android.settings is that app on its own platform only, so with an iPhone named in device it returns an empty map.
How do you narrow the list?
| Meaning | |
|---|---|
| url | Required. The app, as app://<app>. A path such as app://settings/general keeps only the links under it. |
| search | Keeps the links whose name or address contains these words, best match first. Up to 500 characters. |
| limit | The most links to return, 1 to 5000. Defaults to 5000. |
| device | The phone whose platform's map to read. |
| workspaceId | The workspace, for a credential that can reach several. An API key can leave it out. |
search ranks its matches: a name that is the search, then a name that starts with it, then a name that contains it, then an address that contains it. Fields map does not know are ignored.
Map and scrape fit together in two calls. Find the address, then read the screen. With jq:
URL=$(curl -s "https://api.lusor.ai/v1/map" \
-H "X-Api-Key: $LUSOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "app://settings", "search": "about", "limit": 1 }' | jq -r '.links[0].url // empty')
if [ -z "$URL" ]; then
echo "map knows no screen that matches this search" >&2
else
curl "https://api.lusor.ai/v1/scrape" \
-H "X-Api-Key: $LUSOR_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"url\": \"$URL\", \"formats\": [\"markdown\"] }"
fiThe scrape call answers with a task id, and scrape a phone app like a web page shows how to read the document back.
What does map return for an app nobody has run?
An empty links list and a message that says why.
{
"success": true,
"links": [],
"coverage": { "recorded": 0, "base": 0 },
"checkedAt": null,
"message": "No screens of \"amazon\" are known yet. Every scrape, crawl and agent run in the app adds the screens it passes through."
}To add an app's screens to its map, run a scrape or an agent task in that app. An agent task can work through an app you have no addresses for, and every screen it passes through is recorded. The post introducing agent for phone apps covers it.
Is a map call safe to retry?
Each answered call is charged, an empty list included. A call that is refused or fails, with any 4xx or 5xx, is not charged. Send an Idempotency-Key header to retry without a second charge.
- A repeat with the same key and the same request within 24 hours returns the first response, with the header
Idempotent-Replayed: true, and is not charged again. - A refused or failed call does not use up its key, so a retry with it runs.
- The same key with a different request returns
422 idempotency_key_reused, and a key whose request is still running returns409 idempotency_key_in_use.
A read that takes too long returns 503 map_timeout and is not charged. Try again, or narrow it with a path or search. For how retries work on the calls that hold a phone, see queued turns and safe retries.
What are map's limits today?
- iPhone maps are thin. Most taps on an iPhone are recorded by position, with no row name, and a tap with no name cannot be an address step. In one production workspace's recorded map, Android Settings gave 14 addresses and iPhone Settings gave only
app://settings/battery. - The base map is English iPhone Settings only.
- An address works on the platform and in the language it was recorded in. One address per screen across platforms and languages is not built yet.
The search and crawl calls are not available yet. Map, scrape, agent and interact are the four app-data calls Lusor runs today. Every field and error code is in the map docs, next to the scrape docs and the agent docs.
Frequently asked questions
What does Lusor's map call return?
A list of links, each with an app:// url that Lusor's scrape call can follow and a title, the screen's name as a person sees it. The response also has coverage, which counts the links from your workspace's runs and from Lusor's base map, and checkedAt, when a run last read one of the app's mapped screens.
Does map open the app on a phone?
No. Map reads what your workspace's earlier runs recorded, plus a base map Lusor ships. It never opens the app, holds no phone and runs no model, so it answers at once and is not a task. There is no id to read later.
Why does map return no links for an app?
No run in your workspace has passed through that app yet, and Lusor's base map does not cover it. The response has an empty links list and a message. Every scrape and agent run in an app records the screens it passes through, so running one in the app adds its screens to the map.
Why does an iPhone map have fewer links than an Android map?
Most taps on an iPhone are recorded by position, with no row name, and a tap with no name cannot be a step in an address. In one production workspace, Android Settings gave 14 addresses and iPhone Settings gave only app://settings/battery.
Is a map call safe to retry?
Yes, with an Idempotency-Key header. A repeat with the same key and the same request within 24 hours returns the first response with the header Idempotent-Replayed: true and is not charged again. A refused or failed call does not use up its key. The same key with a different request returns 422 idempotency_key_reused.