Skip to main content
GET
/
v1
/
posts
JavaScript
import Influship from 'influship';

const client = new Influship({
  apiKey: process.env['INFLUSHIP_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const postListResponse of client.posts.list()) {
  console.log(postListResponse.id);
}
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "profile_id": "123e4567-e89b-12d3-a456-426614174001",
      "platform": "instagram",
      "platform_id": "CxYz123ABC",
      "url": "https://www.instagram.com/p/CxYz123ABC",
      "posted_at": "2024-01-15T14:30:00Z",
      "type": "image",
      "caption": "Starting the week with a killer workout! 💪",
      "media": {
        "url": "https://cdn.example.com/media/post123.jpg",
        "thumbnail_url": "https://cdn.example.com/thumbnails/post123.jpg",
        "video_url": "https://cdn.example.com/videos/post123.mp4",
        "duration_seconds": 45
      },
      "metrics": {
        "likes": 4500,
        "comments": 120,
        "views": 15000,
        "shares": 50,
        "engagement_rate": 3.8
      },
      "hashtags": [
        "fitness",
        "workout",
        "motivation"
      ],
      "mentions": [
        "nike",
        "gymshark"
      ],
      "location": {
        "name": "Los Angeles, California"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "eyJvZmZzZXQiOjI1fQ=="
}

Authorizations

X-API-Key
string
header
required

Query Parameters

platform
enum<string>

Platform (required with username)

Available options:
instagram
Example:

"instagram"

username
string

Username (required with platform)

Required string length: 1 - 50
Example:

"fitness_coach_jane"

creator_id
string<uuid>

Creator ID (use this OR platform+username)

Example:

"123e4567-e89b-12d3-a456-426614174000"

limit
integer
default:12

Maximum posts to return

Required range: 1 <= x <= 50
Example:

12

sort
enum<string>
default:recent

Sort order

Available options:
recent,
top_engagement,
most_likes,
most_views,
most_comments
Example:

"recent"

cursor
string

Pagination cursor for next page

Response

Successful response

data
object[]
required
has_more
boolean
required

Whether more results are available

Example:

true

next_cursor
string | null
required

Cursor for the next page of results

Example:

"eyJvZmZzZXQiOjI1fQ=="