Skip to main content

SDKs

Official SDK for integrating with the Influship API.

TypeScript / JavaScript

The official SDK is generated by Stainless with full TypeScript types.

Installation

npm install influship

Quick Start

import Influship from 'influship';

const client = new Influship({
  apiKey: process.env.INFLUSHIP_API_KEY
});

// Search for creators
const results = await client.creators.search({
  query: 'fitness influencers with high engagement',
  limit: 10
});

console.log(results.items);

Common Operations

const results = await client.creators.search({
  query: 'sustainable fashion creators',
  filters: {
    platform_filters: [{
      platform: 'instagram',
      min_followers: 10000,
      min_engagement_rate: 3.0
    }]
  },
  limit: 25
});

results.items.forEach(creator => {
  console.log(creator.name, creator.match.score);
});

Error Handling

import Influship, { APIError, RateLimitError } from 'influship';

try {
  const results = await client.creators.search({
    query: 'fitness'
  });
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log('Rate limited, retry after:', error.retryAfter);
  } else if (error instanceof APIError) {
    console.log('API error:', error.message);
    console.log('Status:', error.status);
  } else {
    throw error;
  }
}

TypeScript Types

The SDK includes full TypeScript definitions:
import type {
  SearchRequest,
  SearchResponse,
  Creator,
  Profile,
  LookalikeRequest,
  LookalikeResponse
} from 'influship';

// All request/response types are exported
const searchParams: SearchRequest = {
  query: 'fitness',
  limit: 10
};

Python SDK

Coming soon. For now, use the REST API directly with requests or httpx:
import requests

API_KEY = 'your_api_key'

response = requests.post(
    'https://api.influship.com/v1/search',
    headers={'X-API-Key': API_KEY},
    json={
        'query': 'fitness influencers',
        'limit': 10
    }
)

results = response.json()
print(results['items'])

Interactive Examples

See the API Reference for interactive examples of every endpoint with code snippets in multiple languages.
The API Reference includes an interactive playground where you can test endpoints directly from the docs.