# X (Twitter) Mutual Follow & Relationship Checker (`arjun_code/x-twitter-follow-relationship-checker`) Actor

Check whether two X / Twitter accounts follow each other. Detect mutual, one-way, or no-follow relationships using usernames, profile URLs, or user IDs. No login, cookies, API keys, or proxy setup required. Export structured results or automate checks through the Apify API, Tasks, and schedules.

- **URL**: https://apify.com/arjun_code/x-twitter-follow-relationship-checker.md
- **Developed by:** [Arjun Data](https://apify.com/arjun_code) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 successful follow relationship checks

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

Check whether two X / Twitter accounts follow each other in either direction. One comparison shows whether the relationship is **mutual, one-way, or neither**.

Enter usernames, `@handles`, full profile URLs, numeric user IDs, or a mixture of these formats. No X login, cookies, API key, or proxy configuration is required.

### What can this Actor do?

- Check both follow directions with one run.
- Distinguish mutual follows, one-way follows, and no follow relationship.
- Resolve usernames, X/Twitter profile URLs, and stable numeric user IDs.
- Return readable summaries for people and structured fields for APIs and automations.
- Export the result as JSON, CSV, Excel, XML, or RSS from the Apify Dataset.
- Automate recurring checks with Apify Tasks, schedules, webhooks, API, and integrations.

Use it for social-graph research, creator and brand relationship checks, outreach qualification, public-account monitoring, and workflow validation.

### How to use

1. Enter **First account (A)**.
2. Enter **Second account (B)**.
3. Click **Start**.
4. Open the Dataset **Overview** to see both follow directions.

Each account can be entered as:

- Username: `elonmusk`
- Handle: `@elonmusk`
- Profile URL: `https://x.com/elonmusk`
- Numeric user ID: `44196397`

### Input

```json
{
  "firstAccount": "elonmusk",
  "secondAccount": "SpaceX"
}
```

Both fields are required and must identify two different accounts. This Actor compares one account pair per run.

### Output

Each run stores one Dataset item. The human-readable `relationship_summary` gives the answer directly, while the boolean fields and `relationship_type` support filtering and automation.

```json
{
  "status": "success",
  "message": "",
  "relationship_summary": "@elonmusk and @SpaceX follow each other.",
  "relationship_type": "mutual",
  "checked_at": "2026-10-11T05:06:46.950550Z",
  "first_account_requested": "elonmusk",
  "first_account_user_id": "44196397",
  "first_account_username": "elonmusk",
  "first_account_profile_url": "https://x.com/elonmusk",
  "second_account_requested": "SpaceX",
  "second_account_user_id": "34743251",
  "second_account_username": "SpaceX",
  "second_account_profile_url": "https://x.com/SpaceX",
  "first_follows_second": true,
  "second_follows_first": true,
  "mutual_follow": true
}
```

#### Relationship types

| `relationship_type` | Meaning |
| --- | --- |
| `mutual` | Account A and account B follow each other. |
| `first_follows_second` | Account A follows account B, but account B does not follow account A. |
| `second_follows_first` | Account B follows account A, but account A does not follow account B. |
| `neither` | Neither account follows the other. |

### Invalid or unavailable accounts

Invalid input does not produce a misleading relationship. The Dataset item uses `status: "invalid_input"`, explains what to correct in `message`, and leaves relationship values as `null`.

If X reports that either account does not exist, is suspended, or is unavailable, the result uses `status: "account_unavailable"`. Temporary request failures use `status: "request_failed"`.

### Automate X follow relationship checks

Save any account pair as an **Apify Task** and run it on a schedule to monitor whether the relationship changes. Use webhooks to notify another service after a run, or consume the structured Dataset result through the Apify API, Make, Zapier, Google Sheets, or your own application.

The Actor can also be exposed to AI clients through the Apify MCP Server:

```text
https://mcp.apify.com/?tools=arjun_code/x-twitter-follow-relationship-checker
```

### How much does an X follow relationship check cost?

The Actor uses pay-per-event pricing. One `relationship-check-result` event is charged only when both accounts are resolved and a follow relationship is successfully saved. `invalid_input`, `account_unavailable`, and `request_failed` rows are not charged as successful checks.

| Apify plan | Per successful check | Per 1,000 successful checks |
| --- | ---: | ---: |
| Free | $0.00050 | $0.50 |
| Bronze | $0.00045 | $0.45 |
| Silver | $0.00040 | $0.40 |
| Gold | $0.00035 | $0.35 |
| Platinum | $0.00035 | $0.35 |
| Diamond | $0.00035 | $0.35 |

An `apify-actor-start` event costs $0.00005 per run. Platform usage is included in the configured event prices. The Pricing tab is the source of truth if prices change later.

### Run with the API

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/arjun_code~x-twitter-follow-relationship-checker/runs" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"firstAccount":"elonmusk","secondAccount":"SpaceX"}'
```

The run output contains a link to the default Dataset, where the result can be previewed, downloaded, or consumed by another workflow.

### Related X / Twitter Actors

| Actor | Best for |
| --- | --- |
| [X Followers & Following Scraper](https://apify.com/arjun_code/x-twitter-followers-followings-scraper) | Exporting the available followers or following of public accounts |
| [X People Search Scraper](https://apify.com/arjun_code/x-twitter-people-search-scraper) | Finding X profiles by keyword and profile filters |
| [X Account Origin Scraper](https://apify.com/arjun_code/x-twitter-account-origin-scraper) | Checking account origin and public account metadata |

### Frequently asked questions

#### Do I need X cookies, an API key, or a proxy?

No. Enter the two accounts you want to compare. The Actor manages the required access and proxy routing.

#### Can I monitor a relationship over time?

Yes. Save the input as an Apify Task and attach a schedule. Each run returns a timestamped snapshot that can be sent to a webhook or another integration.

#### Does the result include the date an account followed another account?

No. X returns the current follow relationship, not the date when that relationship began.

#### What happens when an account does not exist or is suspended?

The Dataset returns `status: "account_unavailable"` with a readable message. It does not report a missing account as a valid no-follow relationship.

#### Where can I report a problem?

Open an issue on the Actor page and include the Run ID. Do not post private credentials or account cookies.

### Important limitations

- The result is a current relationship snapshot, not historical data.
- X does not provide the date when either account followed the other through this operation.
- Deleted, suspended, restricted, or temporarily unavailable accounts may return `account_unavailable`.

This independent Actor is not affiliated with, endorsed by, or sponsored by X Corp.

# Actor input Schema

## `firstAccount` (type: `string`):

Account A. For example: elonmusk, @elonmusk, https://x.com/elonmusk, or 44196397.

## `secondAccount` (type: `string`):

Account B. For example: SpaceX, @SpaceX, https://x.com/SpaceX, or 34743251.

## Actor input object example

```json
{
  "firstAccount": "elonmusk",
  "secondAccount": "SpaceX"
}
```

# Actor output Schema

## `results` (type: `string`):

The comparison result stored in the default dataset.

# 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 = {
    "firstAccount": "elonmusk",
    "secondAccount": "SpaceX"
};

// Run the Actor and wait for it to finish
const run = await client.actor("arjun_code/x-twitter-follow-relationship-checker").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 = {
    "firstAccount": "elonmusk",
    "secondAccount": "SpaceX",
}

# Run the Actor and wait for it to finish
run = client.actor("arjun_code/x-twitter-follow-relationship-checker").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 '{
  "firstAccount": "elonmusk",
  "secondAccount": "SpaceX"
}' |
apify call arjun_code/x-twitter-follow-relationship-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arjun_code/x-twitter-follow-relationship-checker"
        }
    }
}
```

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/VkBtC1jFS5Nf9VOYh/builds/qPbt4BYifmBeKhggb/openapi.json
