> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airtop.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airtop.ai/_mcp/server.

# Form Filling

Although Airtop already has the necesssary primitives to fill forms (clicking, typing, etc), form filling is such a common use case that we created it's dedicated API to make it easier and a lot faster to fill forms.

## How to fill a form

To fill a form, you need to follow these steps:

1. Create a session and load a website that contains the form you want to fill
   ```typescript
     const session = await client.sessions.create();
     const window = await client.windows.create(session.data.id, {
       url: "https://docs.google.com/forms/d/e/1FAIpQLSdR1-QUVcufdr64IMWE-mOaOCjWfU3yudhaAw8unc4UfOqKEQ/viewform",
     });
   ```

2. Fill out the form
   ```typescript
     await client.windows.fillForm(session.data.id, window.data.windowId, {
       automationId: "auto",
       parameters: {
         customData: `
   Favorite data in all of history: 01/16/1986
   Favorite time of day: 9am
   Favorite aspect of the world: the weather
   Do you like planets: I like inner planets and outer planets
   Choose planets you care about: Mars
   Favorite animal: dog
   Score of earth: 10
   Stars to give earth: 4
   Car: least, animal: moderate, planet: most
   Cars: Honda
         `
       }
     });
   ```

3. Observe how the form is filled automatically

![Form Filling Example](/_fern-files/docs.airtop.ai/e40aeff17dd95620098050020c88c2575577b9064cd6bef504bd041f28f2c8a6/airtop.docs.buildwithfern.com/2025-10-13T19:00:44.461Z/images/form-filling/form.gif)

## How does it work?

The form filling API executes as a 2 step process. First, the API will analyze the page to understand the structure of the form elements. Then, the API will fill the form elements with the provided custom data. The custom data will be mapped to the form elements based on the analysis of the page and the description of the data provided. It's important that you describe the data in a way that is easy for the AI to understand and map to the form elements.

## Experiment with the form filling API

You can experiment with the form filling API in the [API Playground](https://portal.airtop.ai/).

![Form Filling API Playground](/_fern-files/docs.airtop.ai/2c514595d909ff991f4dddc80dcbcbd683a7a9b01b9585fa39d7d12af2f0924e/airtop.docs.buildwithfern.com/2025-10-13T19:00:44.461Z/images/form-filling/studio-form.gif)

Form filling is in beta and we'd love to hear your feedback. Reach out to us on [Discord](https://discord.gg/68a4rE4Pzx) if you have any questions or feedback.