# iNext Ariba (`courtly_fender/inext-ariba`) Actor

- **URL**: https://apify.com/courtly_fender/inext-ariba.md
- **Developed by:** [Harry Potter](https://apify.com/courtly_fender) (community)
- **Stats:** 1 total users, 1 monthly users, 62.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Ariba Supplier Leads Scraper

Logs in to the SAP Ariba supplier portal, opens Leads > All Leads, searches a keyword
(e.g. Singhealth), sorts by Date - Most Recent, and saves rows to the dataset.

### Run

- Console: Actors > Create new > "Import from local" (or `apify push`), then fill Input.
- Local: `npm i && apify run` (put input in `storage/key_value_stores/default/INPUT.json`).

### First run

Selectors are text-based guesses. Open the Key-value store screenshots
(login-filled, after-login, all-leads, results-page-1) and tweak `src/main.js` if a step fails.

### Notes

- Password is `isSecret`, so Apify encrypts it. Never hardcode it.
- Use Apify residential/Singapore proxy if Ariba blocks datacenter IPs.
- If the account has MFA/captcha, automated login will stop at the login page.

# Actor input Schema

## `username` (type: `string`):

Optional. If empty, the ARIBA_USERNAME secret environment variable is used.

## `password` (type: `string`):

Optional. If empty, the ARIBA_PASSWORD secret environment variable is used.

## `keyword` (type: `string`):

Keyword typed into the Leads search box, for example the buyer name (Singhealth).

## `maxItems` (type: `integer`):

Maximum number of leads to return, newest first.

## `fetchDetails` (type: `boolean`):

Open every lead and read Basic Information, Post Overview and Attachments. Slower but gives the full description.

## `skipIds` (type: `array`):

Lead IDs already stored by the backend. Their detail pages are not opened again, which saves time.

## `statusFilter` (type: `string`):

Accepted for compatibility with the backend. Ariba leads in search results are open postings.

## `tenderCategory` (type: `array`):

Accepted for compatibility with the backend. Not used for Ariba.

## `maxPages` (type: `integer`):

Safety limit on result pages to read (10 leads per page).

## `loginUrl` (type: `string`):

Ariba supplier portal URL where the login starts.

## `debug` (type: `boolean`):

Save screenshots of key steps to the Key-value store to help troubleshoot.

## Actor input object example

```json
{
  "keyword": "Singhealth",
  "maxItems": 20,
  "fetchDetails": true,
  "skipIds": [],
  "statusFilter": "open",
  "tenderCategory": [],
  "maxPages": 20,
  "loginUrl": "https://service.ariba.com/Supplier.aw",
  "debug": true
}
```

# Actor output Schema

## `leads` (type: `string`):

Dataset of scraped Ariba leads: ID, title, type, category, respond-by date, budget, locations, description, attachments and more.

## `debugScreenshots` (type: `string`):

Screenshots and debug records saved during the run (only when the debug input is on).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("courtly_fender/inext-ariba").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("courtly_fender/inext-ariba").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call courtly_fender/inext-ariba --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,courtly_fender/inext-ariba"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mRv1W9CQNbqdbOEq6/builds/9447bdzQ1cIWkEBuc/openapi.json
