For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportPlayground
DocumentationAPI ReferenceRelease Notes
DocumentationAPI ReferenceRelease Notes
  • Get Started
    • Welcome
    • Quick Start
  • Learn About MultiOn
    • Browser Extension
    • Sessions
    • Retrieve
    • Skills
  • Build With MultiOn
    • Post on X
    • Scrape H&M
    • Order on Amazon
    • Cookbook
LogoLogo
SupportPlayground
On this page
  • Project setup
  • Add book to cart
  • Buy the book!
Build With MultiOn

Order on Amazon with MultiOn

Was this page helpful?
Previous

Cookbook

Next
Built with

This example combines MultiOn browse and local mode to purchase a book on Amazon.

Project setup

TypeScript
Python
1

Install extension

Find the MultiOn Browser Extension on the Chrome Web Store and click “Add to Chrome” to add it to your browser. Make sure the API Enabled option is checked. Learn more about the browser extension here.

2

Initialize project

Create a new project by running the following command in your terminal:

$npm init
3

Install package

Install the multion package by running the following command in your terminal:

$npm install multion
4

Import library

Create a new file called index.ts and import the required library for the example:

1import { MultiOnClient } from 'multion';
5

Initialize client

Initialize the MultiOn client with your API key.

1const multion = new MultiOnClient({ apiKey: "YOUR_API_KEY" });
6

Run script

Run your script by running the following command in your terminal:

$node index.ts

Add book to cart

Use browse in local mode to add the book to your shopping cart.

1const cartResponse = await multion.browse({
2 cmd: "Add the Three Body Problem book to my cart",
3 url: "https://amazon.com",
4 local: true
5});
6
7console.log(cartResponse.message);

Buy the book!

Now, if you want to buy the book, continue the same session to complete the purchase.

1const sessionId = followResponse.sessionId
2
3const purchaseResponse = await multion.browse({
4 sessionId: sessionId,
5 cmd: "Check out and purchase the book"
6});
7
8console.log(purchaseResponse.message);