How to Automate a Website With No API Using Browser Automation
Summary
- JavaScript runs on 98.9% of all websites, so the data inside no-API portals is rendered client-side, which is why replaying network requests breaks on session-bound tokens, request signing, and bot detection.
- Four primitives make a no-API workflow reproducible: a precise
taskstring, deterministic auth viainitial_actionsor PlaywrightstorageState, anoutput_model_schemafor validated JSON, and execution limits (max_steps,step_timeout,max_failures). - Per-task cost can vary roughly 50x depending on the LLM, with browser compute at about $0.02 per hour — start with the smallest capable model and scale up only if output quality falls short.
- Run every browser agent with real credentials in an isolated, ephemeral sandbox such as E2B's
kernel-browser, and treat step-by-step screenshots as a timestamped audit trail rather than a debugging aid. - Teams that prefer not to maintain this stack use Jinba Flow to automate legacy portal tasks on-premise, with no API required, typically moving from portal audit to working automation in days.
Most automation guides assume an API exists. A large share of operational work happens inside portals that have no API: vendor dashboards, internal admin tools, legacy procurement systems, and partner portals that expose every function through a web UI and nothing else. Scripting against those portals with raw HTTP requests fails quickly because JavaScript runs on 98.9% of all websites, so the content developers need is rendered client-side rather than delivered in a parseable HTTP response.
Browser automation without an API is the correct framing for this class of problem. The solution is to drive a real browser programmatically, as a human would, and extract structured output at the end.
Why HTTP Replay Breaks on Modern Portals
The alternative to browser automation is replaying the underlying network requests: reconstruct the headers, cookies, and payloads a browser sends, and call the hidden API directly. That approach works on simple sites but fails on most portals.
Modern web applications use session-bound tokens, request signing, and dynamically generated class names that change on every page load. That means selectors written against the DOM yesterday break silently after a routine front-end deploy. Beyond that, a WAF or bot-detection layer can identify and block request replay even when the technical parameters look correct.
Browser automation takes the opposite approach: it interacts with the rendered page, so it is resilient to changes in the underlying code as long as the visual layout remains similar. A headless Chromium instance controlled via the Chrome DevTools Protocol sees exactly what a human sees. That makes it the only reliable option when an API is absent or obfuscated.

Step 1: Describe the Task in Plain Language
The first input to a browser agent is a natural-language browser task: a plain-text instruction that describes what to open, what to log in with, what to fill, and what to extract.
A well-formed instruction is specific and sequential:
"Go to the Acme Corp partner portal, log in with the credentials in environment variables, navigate to the Q3 sales report, and extract the total revenue and top three deal names."
This description becomes the agent's directive and doubles as self-documenting specification. The more concrete the instruction, the fewer recovery steps the agent needs to take.
Step 2: Execute the Task
The browser_use library wraps a Playwright-controlled browser inside an LLM agent loop. A minimal runnable agent requires only a task string and an LLM:
from browser_use import Agent, ChatBrowserUse
agent = Agent(
task="Go to the Acme partner portal, log in, navigate to the Q3 sales report, and extract the total revenue.",
llm=ChatBrowserUse()
)
history = await agent.run(max_steps=100)
print(history.output)
The history object returned by run() carries the agent's output and its full action trace.
Three parameters bound what the agent can do before it stops:
max_steps(default 100): caps the total number of reasoning and action steps.step_timeout(default 180 s): prevents any single step from hanging indefinitely.max_failures(default 5): limits retries on errored steps before the run stops.
Production deployments set these explicitly rather than relying on defaults. An uncapped agent on a misbehaving portal continues running and consuming LLM tokens until an external timeout stops it.
A fallback_llm parameter accepts a backup model that activates when the primary LLM returns 429 or 5xx errors, providing resilience without manual intervention.
Step 3: Extract Structured JSON for Downstream Use
A free-text summary of what the agent found is not machine-readable. The clean integration point for browser automation in any larger workflow is schema-validated JSON.
The output_model_schema parameter accepts a Pydantic model. The agent enforces that structure on its output before returning.
from pydantic import BaseModel, Field
from browser_use import Agent, ChatBrowserUse
class SalesReport(BaseModel):
total_revenue: float = Field(description="Total revenue for Q3.")
top_deals: list[str] = Field(description="Top three deal names.")
agent = Agent(
task="Go to the Acme partner portal, log in, navigate to the Q3 sales report, and extract the fields.",
output_model_schema=SalesReport,
llm=ChatBrowserUse()
)
history = await agent.run(max_steps=100)
# history.output is a validated SalesReport instance
print(history.output.total_revenue)
The output is now typed and validated. It can be passed directly to a database write, an API call, or a downstream AI step without a parsing layer in between. This is what makes browser automation a composable data extraction primitive rather than a one-off script.
Step 4: Handle Logins and Reuse Sessions
Authentication is where most portal automation breaks. MFA prompts, session timeouts, and CSRF tokens all interrupt a naive login flow. Two mechanisms address this at different layers.
Playwright storageState
Log in once, then save the entire browser state (cookies, localStorage, session tokens) to a JSON file:
await context.storage_state(path="playwright/.auth/state.json")
Subsequent runs load that file and start in an already-authenticated state, bypassing the login form and any MFA step. Playwright recommends adding playwright/.auth/ to .gitignore explicitly: the state file contains tokens that can be used to impersonate the session.
Browser Use initial_actions
For cases where persisting state is not appropriate, initial_actions accepts a list of deterministic, non-LLM actions that run before the main task begins. These are typed steps: fill this field with this value, click this selector. A reproducible login sequence that does not depend on the LLM to interpret a form provides a stable, auditable entry point.
Combining both gives broad coverage: storageState for sessions that persist across runs, initial_actions for environments where state files cannot be stored or trusted.
Running Automation in an E2B Sandbox
Running a browser with credentials on a local machine or shared server creates exposure: a compromised machine exposes the sessions it holds. The production practice is to execute each run in an isolated, ephemeral environment.
E2B's kernel-browser sandbox template ships Playwright and Browser Use pre-installed inside a cloud Chromium environment accessible via the Chrome DevTools Protocol. Each run gets its own isolated container. Sessions are separate from the local machine and from each other.
E2B's Kernel browsers support persistent sessions that can be paused and resumed across hours or days, which matters for multi-step workflows that depend on a portal's internal navigation state. The sandbox variant also enables programmatic screenshots at each step (page.screenshot(path=...)), which provides an audit trail rather than a debug aid: a timestamped record of every action the agent took, providing non-repudiable evidence of what was clicked and when.
This is the correct architecture for any automation that touches sensitive portals, financial dashboards, or systems where an errant click has a real cost.
Managing Cost: Jinba Credits vs. Your Own API Key
Browser automation has three cost components: LLM tokens, browser compute time, and any proxy traffic. The model selection decision dominates.
Browser Use Cloud pricing illustrates the scale: per-task cost can vary approximately 50x depending on the LLM used. A capable but lightweight model handles a well-defined extraction task at a fraction of the cost of a frontier model. The frontier model justifies its cost only for tasks that require complex reasoning across ambiguous page structures.
Two billing structures are available:
- Managed credits (e.g., Jinba Credits): A pay-as-you-go model with non-expiring credits. Browser compute runs at $0.02 per hour. One vendor bills for everything: compute, tokens, and tooling.
- Bring Your Own Key (BYOK): The customer provides an LLM API key and pays the model provider directly. The platform adds a fee on top. This model gives full visibility into token consumption and is not a re-priced black box.
For teams running exploratory or low-volume automation, the managed credit model simplifies accounting. For teams with predictable, high-volume workloads and existing model contracts, BYOK reduces per-task cost at the expense of an additional billing relationship to manage.
The practical starting point: run the task with the smallest capable model and measure output quality. Scale to a larger model only if quality is insufficient.
What to Build Next
To automate website without api access, four primitives compose a reproducible workflow:
- A precise
taskstring as the natural-language instruction initial_actionsorstorageStatefor deterministic authenticationoutput_model_schemafor validated JSON outputmax_steps,step_timeout, andmax_failuresto bound execution
Every no-API portal that currently requires a human to log in, fill a form, and copy out data is a candidate for this pattern; the browser is the interface and a well-configured agent is the operator.
The next area to address after a working extraction is scheduling and change detection: what triggers a run, and how the workflow signals when a portal's layout has shifted enough to require a task update.

Frequently Asked Questions
What is browser automation with no API?
Browser automation with no API means driving a real browser programmatically instead of calling a web service. Instead of sending HTTP requests to hidden endpoints, an agent opens the page, logs in, clicks through screens, and extracts structured data from what the rendered page actually shows. It works on the visual interface rather than the underlying code, so it survives front-end changes that break request replay. That makes it the only reliable option inside vendor dashboards, internal admin tools, and legacy procurement portals that expose every function through a UI and nothing else.
How do you automate a website that has no API?
Use a browser agent: write a plain-language task description, run it through a library like browser_use that controls a headless Chromium instance, and validate the output against a schema. Four components make the workflow reproducible: a precise task string, deterministic authentication via initial_actions or Playwright storageState, an output_model_schema for typed JSON, and execution limits (max_steps, step_timeout, max_failures) so a misbehaving portal cannot burn tokens indefinitely. The browser is the interface; the configured agent is the operator.
Why is request replay or raw HTML scraping insufficient?
Modern portals render content client-side and bind requests to session state. JavaScript runs on 98.9% of all websites, so the required data often never appears in a parseable HTTP response. Portals also use session-bound tokens, request signing, and class names that change on every page load, which means selectors written yesterday break silently after a routine deploy; a WAF or bot-detection layer can also block request replay even when the parameters look correct.
How do you handle logins, MFA, and session timeouts?
Log in once, persist the resulting browser state, or script the login deterministically. Playwright's storageState saves cookies, localStorage, and session tokens to a JSON file so later runs start already authenticated and bypass the login form and MFA step; keep that file out of version control, since it can be used to impersonate the session. Where persisting state is not appropriate, initial_actions runs a fixed, non-LLM sequence of typed steps (fill this field, click this selector) before the agent's main task begins, giving operators a stable and auditable entry point.
Which LLM should I use, and what does browser automation cost?
Start with the smallest capable model and scale up only if output quality is insufficient. Per-task cost can vary roughly 50x depending on the LLM, and a lightweight model handles a well-defined extraction task at a fraction of a frontier model's price; the frontier model justifies itself only for complex reasoning across ambiguous page structures. Total cost has three components: LLM tokens, browser compute time (around $0.02 per hour), and proxy traffic. These are billed either as managed, non-expiring credits or as BYOK, where the customer pays the model provider directly and the platform adds a fee.
Is it safe to run a browser agent with real credentials?
It is not safe on a local machine or a shared server, where a compromised host means compromised sessions. Run each automation in an isolated, ephemeral environment such as E2B's kernel-browser sandbox template, which ships Playwright and Browser Use pre-installed in a cloud Chromium environment accessible over the Chrome DevTools Protocol. Each run gets its own container, sessions stay separate from the local machine and from each other, and programmatic screenshots at every step double as a timestamped audit trail of what was clicked and when.
What is the difference between browser automation and web scraping?
Scraping extracts data from page content; browser automation completes a task end to end. A scraping script reads a page, while a browser agent logs in, navigates, fills forms, recovers from interruptions, and returns schema-validated JSON that passes directly into a database write or an API call with no parsing layer in between. For no-API portals that distinction matters, because the value is usually the completed transaction rather than the numbers on the screen.
How long does it take to build a working no-API automation?
A single, well-scoped extraction task can run reliably within hours, because the effort sits in the boundaries rather than the nominal execution path. Most of the work goes into a precise task description, a stable authentication path, and sensible max_steps, step_timeout, and max_failures values. Teams running on Jinba Flow typically move from a portal audit to a working on-premise automation in days, rather than a custom integration project measured in months.
How do you know when a portal changes and breaks the automation?
Expect a silent failure when a layout shifts, and instrument for it from the outset. Watch for repeated hits against max_failures, Pydantic validation errors on the output schema, and missing or null fields in the extracted result, and schedule runs so a failure surfaces before a human is waiting on the data. Treating scheduling and change detection as a core part of the build, rather than an afterthought to the working script, keeps a no-API workflow dependable after the first successful demonstration.