This example shows how to automate the I‑94 recent travel history lookup and extract the result data from a network call, instead of scraping the page. The automation:Documentation Index
Fetch the complete documentation index at: https://docs.optexity.com/llms.txt
Use this file to discover all available pages before exploring further.
- Opens the I‑94 site
- Fills the traveler details (name, nationality, DOB, document number)
- Handles a scroll‑to‑accept popup using a Python script action
- Submits the form and extracts the result from a network request
Quickstart using built-in automation
You can use the built-ini94 automation to quickly start the inference server and run the automation. The automation is available in the repository under optexity/examples/i94.py.
Add automation to the dashboard
To quickly add the automation to the dashboard, you can use the following command:.env file should be created in the root of the repository in the Local Setup guide. This will add the automation to your dashboard.

Run the i94 automation via inference
For a detailed explanation of the inference server, see the Quickstart guide. Below is the minimal flow to run this example.
Start the inference server
From the project root:Invoke the i94 endpoint
You can call the i94 automation via the /inference endpoint:
- Inspect the task run and extracted data in the dashboard
- Re‑use the extracted JSON in downstream systems
Viewing the task run
You can view the task run in the https://dashboard.optexity.com. The task run will show the steps that were executed and the extracted data.
I94 Travel History
A similar automation is available for retrieving full travel history instead of just recent travel records. Theget_i94_travel_history automation follows the same pattern but uses different endpoints:
- URL:
https://i94.cbp.dhs.gov/search/history-search - Network extraction:
https://i94.cbp.dhs.gov/api/services/travel/history
Add automation to the dashboard
Invoke the get_i94_travel_history endpoint
optexity/examples/i94_travel_history.py.
Build the automation from scratch
Record the base workflow
-
Go to the I‑94 site and record a workflow that:
- Navigates to the recent‑search page
- Fills in first name, last name, nationality, date of birth, and document number
- Submits the form and waits for the result
-
After saving, you will see an
i94automation in your dashboard that contains only the interaction actions (clicks, fills, selects). We have also built this automation by default and you can find it in your dashboard.

Refine the automation
Recording captures clicks and inputs, but you still need to:- Tighten some interaction instructions
- Add a network‑call extraction action
- Add a Python script to handle the scroll‑to‑accept popup
Clarify the nationality selection
In the recorded flow, the nationality selection might not have a precise locator. You can let the model drive the selection usingprompt_instructions:
command is not provided, Optexity uses prompt_instructions to decide how to perform the action.
Add a network‑call extraction action
To capture the I‑94 result, add anextraction_action that listens for the specific network call:
Tip: If extraction does not fire, verify the url_pattern in your browser devtools Network tab and make the pattern as specific as needed (path + query if required).
Scroll the popup via Python script
The I‑94 site requires scrolling inside a popup before the “I ACKNOWLEDGE AND AGREE” button becomes clickable. Use apython_script_action to scroll the popup content:
optexity/examples/i94.py. You can also use the optexity dashboard to edit the automation and save it as a new automation.
Note: Script actions run in the same browser context as the page. They are ideal for edge cases like scrolling a specific container, dismissing tricky popups, or calling custom JS helpers.