# Replace a fragile scraper with a typed method

> Describe what your scraper extracts, and Fous builds a method that returns the same fields on every run. When the site changes, Fous repairs it in place and your code keeps calling it the same way. For developers who maintain scrapers and fix them each time a page moves.

Page: https://fous.com/recipes/replace-a-scraper
Updated: 2026-11-23

## What changes for you

|  | Script you maintain | Fous method |
| --- | --- | --- |
| On each call | Runs your code | Runs the saved method |
| Output | Whatever your code parses | Fits a typed schema every time |
| When the site moves | It breaks until you fix it | Fous repairs it in place |
| Logins and 2FA | You store and refresh sessions yourself | Saved connection, signed in again by Fous |

From [How Fous works](https://docs.fous.com/guides/how-it-works), which also compares AI browser agents.

## 1. Describe what the scraper reads

Press Build this in Fous, name the site, and say what your scraper takes and the fields it returns. A screenshot of the page or of the table you read is often the quickest way to show it, and a build takes up to 4 pictures.

## 2. Let Fous build and test it

Fous studies the site, writes the method and tests it on real inputs, usually in about a minute. A build that doesn’t succeed costs nothing. On a paid plan you can also start it from code, pictures included.

Build with a picture:

```
curl https://api.fous.com/v1/builds \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Read this table of tracking events for a shipment",
    "site": "carrier.example.com",
    "images": [{ "url": "https://carrier.example.com/help/tracking-events.png" }]
  }'
```

## 3. Read its contract

The method has an input schema, an output schema and an example. Your code reads its fields from there, and they stay the same on every run.

Read the contract:

```
curl 'https://api.fous.com/v1/methods/carrier.example.com/track_shipment' \
  -H "Authorization: Bearer $FOUS_API_KEY"
```

## 4. Swap the scraper for one request

Where your code ran the scraper, it sends one POST to /v1/runs with the method and its input. The answer’s data has every field of the output schema: what the site did not show is null, and lists are [].

Run it:

```
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "carrier.example.com/track_shipment",
    "input": { "tracking_number": "EX123456789US" },
    "wait": 30
  }'
```

## 5. Let Fous keep it working

Fous checks every method version in use and repairs it in place when the site changes, keeping your input and the shape of data, at no cost. While a repair runs, calls are refused for free with method_repairing and a retry_after, and workflow steps wait for the repair.

A change you ask for that alters the contract makes a new version, and your calls keep running the current one until you switch.

## Good to know

- **Health checks**: A method run in the past 7 days is checked at least daily on every plan, and a failing one every hour. Checks use no credits.
- **Logins**: If your scraper signed in, connect the account once in Studio under [Connections](https://app.fous.com/connections) instead. Fous keeps the session and signs back in when it can.
- **What it costs**: A completed run uses 1 credit. Failed runs and repairs are free, and every plan includes builds.

## In the docs

- [How Fous works](https://docs.fous.com/guides/how-it-works): what a method is and what happens when a site changes.
- [Build a method](https://docs.fous.com/guides/builds): pictures, messages and following a build.
- [Find and manage methods](https://docs.fous.com/guides/methods): contracts, versions and switching between them.
- [Status and repairs](https://docs.fous.com/guides/status): health checks, repairs and what a run gets during one.

## Frequently asked questions

### Does an AI model run on every call?

No. A run executes the saved method: no AI model decides what to click or where to look, and the output fits the same schema every time.

### What happens when the site changes?

Fous repairs the method in place and keeps its inputs and outputs the same, at no cost.

### Can it read pages behind a login?

Yes. Methods run as your team’s connected accounts, two-step sign-in included.
