Basic Example
Fill and submit a contact form:
const response = await fetch("https://mino.ai/v1/automation/run-sse", {
method: "POST",
headers: {
"X-API-Key": process.env.MINO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com/contact",
goal: `Fill in the contact form:
- Name field: "John Doe"
- Email field: "john@example.com"
- Message field: "I am interested in your services."
Then click the Submit button and extract the success message.
`,
}),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = "";
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const lines = buffer.split("\n");
buffer = lines.pop() ?? "";
for (const line of lines) {
if (line.startsWith("data: ")) {
const event = JSON.parse(line.slice(6));
if (event.type === "COMPLETE" && event.status === "COMPLETED") {
console.log("Result:", event.resultJson);
}
}
}
}
Output:
{
"success": true,
"message": "Thank you for contacting us!"
}
Login Flow
Use stealth mode for login pages:
const response = await fetch("https://mino.ai/v1/automation/run-sse", {
method: "POST",
headers: {
"X-API-Key": process.env.MINO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com/login",
goal: `
1. Fill in username field with "user@example.com"
2. Fill in password field with "password123"
3. Click the Login button
4. Wait for dashboard to load
5. Extract the account balance
`,
browser_profile: "stealth",
}),
});
Use stealth mode for login pages to avoid bot detection.
Handle multi-step forms in a single goal:
const response = await fetch("https://mino.ai/v1/automation/run-sse", {
method: "POST",
headers: {
"X-API-Key": process.env.MINO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com/signup",
goal: `Complete the multi-step signup form:
Step 1 (Personal Info):
- First name: "John"
- Last name: "Doe"
- Email: "john@example.com"
- Click "Next"
Step 2 (Address):
- Street: "123 Main St"
- City: "San Francisco"
- State: "CA"
- ZIP: "94102"
- Click "Next"
Step 3 (Preferences):
- Select "Email notifications" checkbox
- Click "Submit"
Extract the confirmation number from the success page.
`,
}),
});
Tips
- Use stealth mode for login/signup forms
- Be explicit about field values in your goal
- Describe buttons by their text (“click ‘Submit’”)
- Handle multi-step forms in one goal
Try It
Save the code
Save any example above as form.mjs
Set your API key
export MINO_API_KEY="your_api_key"