Please Log In

You need to log in to access your API credentials and start using our APIs. Start with our free trial!

Log In & Start Free Trial

Person Interactions API

Fetch social interaction data including tweet replies, followers, and following lists from Twitter/X and Instagram profiles

API Endpoint

https://api.nyne.ai/person/interactions

Try the API Playground

Test the API with our interactive playground to make real requests and see live responses.

Launch Interactions Playground

Overview

The Person Interactions API allows you to fetch social interaction data from Twitter/X and Instagram profiles. This includes people who replied to specific tweets, account followers, and accounts a user follows.

Key Features

  • Tweet Replies: Get users who replied to a specific tweet (Twitter/X)
  • Followers: Retrieve a list of people following an account (Twitter/X)
  • Following: Retrieve accounts that a user follows (Twitter/X and Instagram)
  • Multi-Platform: Support for Twitter/X and Instagram
  • URL Parsing: Automatic extraction of usernames from Twitter/X and Instagram URLs
  • Async Processing: Callback support for high-volume operations
  • Rate Limiting: Built-in throttling and usage controls

Platform Support

Interaction Type Twitter/X Instagram
Replies Yes No
Followers Yes No
Following Yes Yes

Authentication

All API requests require authentication using your API key and secret. You can authenticate using either HTTP headers (recommended) or query parameters.

Header Authentication (Recommended)
X-API-Key: your_api_key_hereX-API-Secret: your_api_secret_here

Rate Limits

API usage is controlled by rate limiting mechanisms to ensure fair usage and system stability:

  • Per Minute: 60 requests
  • Per Hour: 1000 requests
  • Monthly: Varies by plan

Credit Usage

API credits are consumed based on the interaction request:

  • Interaction Request: 3 credits per successful interaction lookup

Credit Efficiency

Credits are only charged when interaction data is successfully retrieved. If no data is found, no credits are charged.

POST /person/interactions

Submit a request to fetch social interaction data.

POST /person/interactions

Parameters

type (string, required)
Type of interaction to fetch
Values: "replies", "followers", "following", "followers,following"
Note: Instagram only supports "following" type
social_media_url (string, required)
Twitter/X or Instagram profile or post URL.
Examples:
  • https://twitter.com/elonmusk
  • https://x.com/elonmusk/status/1234567890
  • https://instagram.com/instagram
max_results (integer, optional)
Maximum number of results to return
Default: 100, Max: 1000
callback_url (string, optional)
URL to receive results asynchronously
Example: https://yourapp.com/webhook/interactions

Request Example (Replies)

{ "type": "replies", "social_media_url": "https://twitter.com/elonmusk/status/1234567890", "max_results": 50 }

Request Example (Twitter Followers)

{ "type": "followers", "social_media_url": "https://twitter.com/elonmusk", "callback_url": "https://yourapp.com/webhook/interactions" }

Request Example (Instagram Following)

{ "type": "following", "social_media_url": "https://instagram.com/instagram", "max_results": 50 }

Response Codes

202 Request accepted for processing

400 Invalid request parameters

401 Invalid API credentials

429 Rate limit exceeded

Response Example

{ "success": true, "data": { "request_id": "interaction_abc123def456_1234567890", "status": "processing", "interaction_type": "replies", "platform": "twitter", "created_on": "2025-01-15T10:30:00Z" }, "timestamp": "2025-01-15T10:30:00Z" }

GET /person/interactions

Check the status of an interaction request and retrieve results.

GET /person/interactions?request_id=

Parameters

request_id (string, required)
The request ID returned from the POST request
Example: interaction_abc123def456_1234567890

Request Example

GET /person/interactions?request_id=interaction_abc123def456_1234567890

Response Codes

200 Status retrieved successfully

400 Invalid request parameters

401 Invalid API credentials

404 Request ID not found

Response Example (Completed)

{ "success": true, "data": { "request_id": "interaction_abc123def456_1234567890", "status": "completed", "interaction_type": "followers", "platform": "twitter", "result": { "interaction_type": "followers", "source_platform": "twitter", "target": { "username": "elonmusk", "display_name": "Elon Musk", "profile_url": "https://twitter.com/elonmusk" }, "interactions": [ { "username": "follower123", "display_name": "John Smith", "profile_url": "https://twitter.com/follower123", "bio": "Tech enthusiast", "followers_count": 1234, "following_count": 567, "verified": false } ], "total_count": 1 }, "result_count": 1, "created_on": "2025-01-15T10:30:00Z", "completed_on": "2025-01-15T10:31:00Z" }, "timestamp": "2025-01-15T10:31:05Z" }

Interaction Type: Replies

Fetch users who replied to a specific tweet.

Example Request

{ "type": "replies", "social_media_url": "https://twitter.com/elonmusk/status/1234567890", "max_results": 100 }

Response Fields

  • username: Twitter handle of the replier
  • display_name: Display name
  • reply_text: Content of the reply
  • reply_date: When the reply was posted
  • likes_count: Number of likes on the reply
  • retweets_count: Number of retweets

Interaction Type: Followers

Fetch users who follow a specific account.

Example Request

{ "type": "followers", "social_media_url": "https://twitter.com/elonmusk", "max_results": 100 }

Response Fields

  • username: Twitter handle of the follower
  • display_name: Display name
  • bio: User biography
  • followers_count: Their follower count
  • following_count: How many they follow
  • verified: Verification status

Interaction Type: Following

Fetch accounts that a specific user follows.

Example Request

{ "type": "following", "social_media_url": "https://twitter.com/elonmusk", "max_results": 100 }

Combined Request

You can fetch both followers and following in a single request:

{ "type": "followers,following", "social_media_url": "https://twitter.com/elonmusk" }

Usage Statistics

Usage statistics are available through the unified usage API at /usage. This endpoint provides comprehensive usage information including credits used, monthly allocation, and breakdown by API type.

Unified Usage API

For detailed usage statistics, please use:

GET /usage

This endpoint shows all your API usage in one place, including interaction requests with proper credit counting.

Response Format

All API responses follow a consistent JSON format:

Success Response

{ "success": true, "data": { "request_id": "interaction_abc123...", "status": "completed", "result": { ... } }, "timestamp": "2025-01-15T10:30:00Z" }

Error Response

{ "success": false, "error": { "code": "error_code", "message": "Error message" }, "timestamp": "2025-01-15T10:30:00Z" }

Error Codes

The API returns structured error responses with specific error codes to help you handle issues programmatically.

Authentication Errors (401)

Error Code Description
missing_credentials API key or secret not provided in request headers
invalid_credentials API key or secret is incorrect or does not match
api_key_expired API key has expired and needs to be renewed

Validation Errors (400)

Error Code Description
missing_parameters Required parameters are missing (type, social_media_url, or request_id)
invalid_interaction_type Unsupported interaction type. Valid types: replies, followers, following, followers,following (Instagram only supports "following")
invalid_url social_media_url is not a valid URL or is from an unsupported platform. Supported: Twitter/X, Instagram
invalid_callback_url callback_url is not a valid HTTP/HTTPS URL
invalid_json Request body contains invalid JSON

Authorization Errors (403)

Error Code Description
subscription_required Your subscription does not include access to this feature
insufficient_credits Not enough credits remaining to process this request
no_active_subscription No active subscription found for this API key
ip_not_allowed Request IP address is not in the allowed list
access_denied Access denied to this resource

Not Found Errors (404)

Error Code Description
request_not_found Request ID not found (for GET status checks)

Rate Limit Errors (429)

Error Code Description
rate_limit_exceeded Too many requests per minute/hour. Please slow down.
monthly_limit_exceeded Monthly request limit exceeded. Resets at start of billing cycle.

Server Errors (500)

Error Code Description
internal_error An unexpected server error occurred. Please try again later.

Error Response Example

{ "success": false, "error": { "code": "invalid_url", "message": "Unsupported social media platform. Supported platforms: Twitter/X, Instagram." }, "timestamp": "2025-01-15T10:30:00Z" }

Callback System

When you provide a callback_url, the API will send the interaction results to your endpoint via HTTP POST when processing is complete.

Callback Request Format

{ "request_id": "interaction_abc123def456_...", "status": "completed", "interaction_type": "followers", "platform": "twitter", "data": { "interaction_type": "followers", "source_platform": "twitter", "target": { ... }, "interactions": [ ... ], "total_count": 50 }, "result_count": 50 }

Callback Retry Policy

  • Maximum 5 retry attempts
  • Exponential backoff: 1s, 5s, 15s, 1m, 5m
  • 30-second timeout per request
  • Your endpoint should return HTTP 2xx for success

Callback Error Format

{ "request_id": "interaction_abc123def456_...", "status": "failed", "interaction_type": "followers", "platform": "twitter", "error": "No interaction data found" }

Important: Your callback endpoint should respond with HTTP 200-299 to indicate successful receipt. Any other response code will trigger a retry.