Skip to main content
Intuned is the browser automation platform for developers and product teams. Follow this step by step tutorial to build, deploy, and call your first browser automaton project on Intuned.

1. Create a workspace

Contact us to create a workspace. Its free to try! A workspace is the top level logical entity allows you to govern access control over your Intuned resources. To read more, checkout Workspace.

2. Create a project

Projects are the core building block in Intuned. Each workspace can have one or more projects. Use a project to build a scraper or, an automation or an integration with website that lacks APIs. Open your workspace and create a new project with name new-project.
New Project

3. Create Books API

APIs are the building blocks of your project. They are the functions that you will call to interact with the browser.
Create new API (api/books.ts).
New API
Copy the following code into the newly created api/books.ts file.
import { BrowserContext, Page } from "playwright-core";
import { extendPlaywrightPage } from "@intuned/sdk/playwright";

interface Params {
  // Add your params here
  category: string;
}

export default async function handler(
  params: Params,
  _playwrightPage: Page,
  context: BrowserContext
) {
  const page = extendPlaywrightPage(_playwrightPage);

  await page.goto("https://books.toscrape.com/");

  // playwright logic
  await page.getByRole("link", { name: params.category }).click();

  // @intuned/sdk helper!
  const result = await page.extractArrayOptimized({
    itemEntityName: "book",
    label: "books-scraper",
    itemEntitySchema: {
      type: "object",
      properties: {
        name: {
          type: "string",
          description: "name of the book",
          primary: true,
        },
        price: {
          type: "string",
          description: "price of the book. An example is £26.80",
        },
      },
      required: ["name", "price"],
    },
  });

  return result;
}

4. Run the API

Test your API in the Intuned IDE.
Pick the books api from dropdown.
Pick api
Click the Run Button.
Run Button
Create a new parameters set for the API you just created. Intuned enables you to create multiple parameter sets for the same API. This helps you to test and iterate on API. Create param set “Novels” and copy the following:
{
  "category": "Novels"
}
New Parameters
Click the Run Button again that the first param set is created.
Run Button
After the API run is complete. You can look at the returned result in the terminal.
Result

5. Deploy it

Intuned enabled you to deploy your project with a click of a button. Lets do it!
Deploy
To learn more about deployments, checkout Deployments.

6. Call your API

Now that your project API is deployed you have multiple ways to call it. You can call the API directly or schedule a job to run it at a specific time. For now, we will call the API directly.
You can create an API key by going to https://app.intuned.io/api-keys
API Key
You can find it by going to https://app.intuned.io/settings/workspace
Workspace Id
Now that you have your API key and your workspace Id, you are ready to call the API. Intuned exposes a REST API that you can call either call directly or use the @intuned/client to call.
# Replace <WORKSPACE_ID> and <API_KEY> with your workspace id and api key from step above.

curl --request POST \
  --url https://app.intuned.io/api/v1/workspace/<WORKSPACE_ID>/projects/new-project/run \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <API_KEY>' \
  --data '{
  "api": "books",
  "parameters": {
    "category": "Novels"
  }
}'