Social Media Scraping API Documentation | EnsembleData

Download OpenAPI specification:Download


EnsembleData is a social media data provider since 2020. We provide unrestricted and publicly available data extracted in real-time from the social media.

Our platform handles millions of requests daily. We do not enforce rate limits due to our ability to rapidly scale our infrastructure based on demand.

Our platform currency is the so-called units. The units charged per request depend on the complexity of the API and the passed parameters. A detailed description of the units charged can be found in each corresponding API documentation.

Check out our pricing. Any questions? Contact us.

Sign up for a free trial.

Run our APIs with Postman!

Customer

Set of APIs for customers for checking their Social Media Scraping APIs usage. Every customer gets assigned a unique token needed for accessing all our APIs. The token has to be used in all the GET requests sent to our infrastructure.

Get Units Used

This API allows ours clients to check the number of units used on a certain date.

API Pricing (per request): 0 units

API usage examples

  • Token does not exist:
    -> Error code 491 returned.
    Cost: 0 units

  • Token exists:
    -> Units usage for date returned.
    Cost: 0 units


Try the API

query Parameters
date
required
string (Date)
Example: date=2022-11-19

Date for which units usage has to be fetched

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/customer/get-used-units"
params = {
  "date": "2022-11-19",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get Units History

This API allows our clients to check the number of units used in the last N days from today.

API Pricing (per request): 0 units

API usage examples

  • Token does not exist:
    -> Error code 491 returned.
    Cost: 0 units

  • Token exists:
    -> Units usage history returned.
    Cost: 0 units


Try the API

query Parameters
days
required
integer (Days)
Example: days=10

Last N days for which units usage history has to be fetched

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

# pip install ensembledata
from ensembledata.api import EDClient

client = EDClient(token="YOUR-TOKEN-HERE")
result = client.customer.get_usage_history(
    days=10,
)

print(result.data)
print(result.units_charged)

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Tiktok

Real-time Tiktok data scraping API for publicly available data. Scrape Tiktok videos, posts, users information and statistics, comments, hashtags, keyword and more.

User Posts From Username

Fetch user posts from their username. Depth 1 returns the 10 most recent posts, depth N returns the N * 10 most recent posts. The endpoint only returns posts that are not restricted by TikTok.

API Pricing (per request): 1 + depth units

API usage examples

  • Username does not exist:
    -> 0 posts returned.
    Cost: 1 unit

  • Username exists, but user does not have any posts:
    -> 0 posts returned.
    Cost: 1 unit

  • Username exists, depth is set to 1 and user has more than 10 posts:
    -> 10 posts returned.
    Cost: 2 units

  • Username exists, depth is set to 1 and user has 5 posts:
    -> 5 posts returned.
    Cost: 2 units

  • Username exists, depth is set to 10 and user has more than 100 posts:
    -> 100 posts returned.
    Cost: 11 units

  • Username exists, depth is set to 10 and user only has 45 posts:
    -> 45 posts returned.
    Cost: 6 units

  • Username exists, depth is set to 100, user only has 15 posts more recent than given oldest_createtime:
    -> 15 posts returned.
    Cost: 3 units


Try the API

query Parameters
username
required
string (Username) non-empty
Example: username=daviddobrik

Username of the user.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

start_cursor
integer (Start Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next start_cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

oldest_createtime
integer (Oldest Createtime)
Example: oldest_createtime=1667843879

This parameter is used as a stopping condition for fetching posts. If a post older than the provided oldest_createtime is found, the system will stop fetching posts and return the results. For instance, if depth is 10, the system will aim to send 10 requests. However, if an oldest_createtime is set, and we find a post which is older than the oldest_createtime, the system will not send any more requests and return the results. Note: we do not filter out posts older than the provided oldest_createtime before returning the results. Please do this filtering in your own integration if required.

alternative_method
boolean (Alternative Method)
Default: false

If true, it uses a more recent method for fetching the posts. In this case, the returned JSON contains a few more fields, for instance captions for the Tiktok videos (cla_info).

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/posts"
params = {
  "username": "daviddobrik",
  "depth": 1,
  "start_cursor": 0,
  "oldest_createtime": 1667843879,
  "alternative_method": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Posts From Secuid

Fetch user posts from their secondary user ID. Depth 1 returns the 10 most recent posts, depth N returns the N * 10 most recent posts. The endpoint only returns posts that are not restricted by TikTok.

API Pricing (per request): depth units

API usage examples

  • secUid does not exist:
    -> 0 posts returned.
    Cost: 1 unit

  • secUid exists, but user does not have any posts:
    -> 0 posts returned.
    Cost: 1 unit

  • secUid exists, depth is set to 1 and user has more than 10 posts:
    -> 10 posts returned.
    Cost: 1 unit

  • secUid exists, depth is set to 1 and user has 5 posts:
    -> 5 posts returned.
    Cost: 1 unit

  • secUid exists, depth is set to 10 and user has more than 100 posts:
    -> 100 posts returned.
    Cost: 10 units

  • secUid exists, depth is set to 10 and user only has 45 posts:
    -> 45 posts returned.
    Cost: 5 units

  • secUid exists, depth is set to 100, user only has 15 posts more recent than given oldest_createtime:
    -> 15 posts returned.
    Cost: 2 units


Try the API

query Parameters
secUid
required
string (Secuid) non-empty
Example: secUid=MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b

The user's secondary user ID.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

start_cursor
integer (Start Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next start_cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

oldest_createtime
integer (Oldest Createtime)
Example: oldest_createtime=1667843879

This parameter is used as a stopping condition for fetching posts. If a post older than the provided oldest_createtime is found, the system will stop fetching posts and return the results. For instance, if depth is 10, the system will aim to send 10 requests. However, if an oldest_createtime is set, and we find a post which is older than the oldest_createtime, the system will not send any more requests and return the results. Note: we do not filter out posts older than the provided oldest_createtime before returning the results. Please do this filtering in your own integration if required.

alternative_method
boolean (Alternative Method)
Default: false

If true, it uses a more recent method for fetching the posts. In this case, the returned JSON contains a few more fields, for instance captions for the Tiktok videos (cla_info).

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/posts-from-secuid"
params = {
  "secUid": "MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b",
  "depth": 1,
  "start_cursor": 0,
  "oldest_createtime": 1667843879,
  "alternative_method": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Info From Username

Fetch user information and statistics from their username. The data returned includes country, language, biography, profile picture, engagement statistics etc.

API Pricing (per request): 1 unit

API usage examples

  • Username does not exist:
    -> null returned.
    Cost: 1 unit

  • Username exists:
    -> info returned.
    Cost: 1 unit


Try the API

query Parameters
username
required
string (Username) non-empty
Example: username=daviddobrik

The username to fetch info for.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/info"
params = {
  "username": "daviddobrik",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Info From Secuid

Fetch user information and statistics from their secondary user ID. The data returned includes country, language, biography, profile picture, engagement statistics etc.

API Pricing (per request): 1 unit

API usage examples

  • secUid does not exist:
    -> null returned.
    Cost: 1 unit

  • secUid exists:
    -> info returned.
    Cost: 1 unit


Try the API

query Parameters
secUid
required
string (Secuid) non-empty
Example: secUid=MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b

The secondary user ID to fetch info for.

alternative_method
boolean (Alternative Method)
Default: false

Use an alternative endpoint for fetching the data. If true, the returned JSON contains some additional information compared to the default method.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/info-from-secuid"
params = {
  "secUid": "MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b",
  "alternative_method": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Info

Fetch post information and statistics from URL.

API Pricing (per request): 2 units


Try the API
query Parameters
url
required
string (Url)
Example: url=https://www.tiktok.com/@daviddobrik/video/7165262254722534698

The url of the post containing the username and video ID. You should be able to copy this value directly from the search bar in your browser.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/post/info"
params = {
  "url": "https://www.tiktok.com/@daviddobrik/video/7165262254722534698",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Multiple Post Info

Fetch information for multiple post IDs.

The endpoint can handle a maximum of 100 posts at once. The endpoint only returns the post information for posts that exist and that are not restricted by TikTok.

API Pricing (per request): 2 * #returned_posts units


Try the API

query Parameters
ids
required
string (Ids) >= 2 characters
Example: ids=7210531475052236078;7102806710334606597;710280671033460623434597

Aweme IDs (Post IDs) separated by semicolons as shown in the example.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/post/multi-info"
params = {
  "ids": "7210531475052236078;7102806710334606597;710280671033460623434597",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Comments

Fetch comments for a given post. Each request returns a chunk of 30 comments.

See the cursor query parameter below for information on how to manage pagination (fetch more comments).

API Pricing (per request): 1 unit

API usage examples

  • Aweme ID does not exist:
    -> null returned.
    Cost: 1 unit

  • Aweme ID exists and has 20 comments:
    -> 20 comments returned.
    Cost: 1 unit

  • Aweme ID exists and has more than 30 comments:
    -> 30 comments and cursor for next request returned.
    Cost: 1 unit


Try the API

query Parameters
aweme_id
required
string (Aweme Id) non-empty
Example: aweme_id=7348608161672187167

The aweme ID of the post (post ID).

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/post/comments"
params = {
  "aweme_id": "7348608161672187167",
  "cursor": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Comment Replies

Fetch the replies to a comments for a given post.

Each request returns a chunk of 30 replies to a comment. See the cursor query parameter below for information on how to manage pagination (fetch more replies).

API Pricing (per request): 1 unit

API usage examples

  • Comment ID does not exist:
    -> null returned.
    Cost: 1 unit

  • Comment ID exists and has 20 replies:
    -> 20 replies to the comment returned.
    Cost: 1 unit

  • Comment ID exists and has more than 30 replies:
    -> 30 replies to the comment and cursor for next request returned.
    Cost: 1 unit


Try the API

query Parameters
aweme_id
required
string (Aweme Id)
Example: aweme_id=7348608161672187167

The aweme ID of the post (post ID).

comment_id
required
string (Comment Id) non-empty
Example: comment_id=7348609403145192198

The id of the comment to fetch replies for.

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/post/comments-replies"
params = {
  "aweme_id": "7348608161672187167",
  "comment_id": "7348609403145192198",
  "cursor": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Music Posts

Fetch the videos which have a particular piece of music in the background.

The music_id will need to be found from other APIs (any of the APIs that return posts, will also contain the music id for the music used in the video).

See the cursor query parameter below for information on how to manage pagination (fetch more results).

API Pricing (per request): 3 units


Try the API

query Parameters
music_id
required
string (Music Id)
Example: music_id=7063948643480488709

The id for the piece of music.

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/music/posts"
params = {
  "music_id": "7063948643480488709",
  "cursor": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Music Details

Fetch detailed information for a music ID.

The music id will need to be found from other APIs (any of the APIs that return posts, will also contain the music id for the music used in the video).

API Pricing (per request): 2 units


Try the API

query Parameters
id
required
string (Id)
Example: id=7063948643480488709

Music ID whose information has to be fetched.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/music/details"
params = {
  "id": "7063948643480488709",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Followers

Fetch followers for a given user.

Each request returns a chunk of 100 followers. See the cursor query parameter below for information on how to manage pagination (fetch more followers). Tiktok returns in total the 5,000 most recent followers. Note: if the secUid doesn't exists, the cost is just 1 unit.

API Pricing (per request): 2 units

API usage examples

  • secUid does not exist:
    -> null returned.
    Cost: 1 unit

  • secUid exists and has 40 followers:
    -> 40 followers returned.
    Cost: 2 units

  • secUid exists and has more than 100 followers:
    -> 100 followers and cursor for next request returned.
    Cost: 2 units


Try the API

query Parameters
id
required
string (Id)
Example: id=6784819479778378757

The id of the user.

secUid
required
string (Secuid) non-empty
Example: secUid=MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b

The secondary id of the user.

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/followers"
params = {
  "id": "6784819479778378757",
  "secUid": "MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b",
  "cursor": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Followings

Fetch followings for a given user.

Each request returns a chunk of 100 followings. See the cursor and page_token query parameters below for information on how to manage pagination (fetch more followings). Note: if the secUid doesn't exists, the cost is just 1 unit.

API Pricing (per request): 2 units

API usage examples

  • secUid does not exist:
    -> null returned.
    Cost: 1 unit

  • secUid exists and has 40 followings:
    -> 40 followings returned.
    Cost: 2 units

  • secUid exists and has more than 100 followings:
    -> 100 followings and cursor for next request returned.
    Cost: 2 units


Try the API

query Parameters
id
required
string (Id)
Example: id=6784819479778378757

The id of the user.

secUid
required
string (Secuid) non-empty
Example: secUid=MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b

The secondary id of the user.

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

page_token
string (Page Token)
Default: ""

Secondary cursor to manage pagination (initially empty). The page_token for next request is returned by the previous response as the nextPageToken. This works in the same way as the cursor parameter.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/followings"
params = {
  "id": "6784819479778378757",
  "secUid": "MS4wLjABAAAAQ45IcDZIqrknyl0FDjs7xDlcxlaRE7CcBx1ENxYkWK00UpeKTTlCQWKxq6t9QM6b",
  "cursor": 0,
  "page_token": "",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Liked Posts

Fetch the list of liked posts of a user (only if publicly available).

See the cursor query parameter below for information on how to manage pagination (fetch more posts).

API Pricing (per request): 1 unit


Try the API

query Parameters
secUid
required
string (Secuid) non-empty
Example: secUid=MS4wLjABAAAAzdgqSwTVcRLGFPY7J-JnwnH3QQQ8sozmxYSmE5Fxeuql6jjokm5Lui0tl_WrDYWD

The secondary id of the user.

cursor
integer (Cursor)
Default: 0

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/tt/user/liked-posts"
params = {
  "secUid": "MS4wLjABAAAAzdgqSwTVcRLGFPY7J-JnwnH3QQQ8sozmxYSmE5Fxeuql6jjokm5Lui0tl_WrDYWD",
  "cursor": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Instagram

Real-time Instagram data scraping API for publicly available data. Scrape Instagram videos, posts, users information and statistics, comments, hashtags, keyword and more.

User Posts

Fetch user posts from the user ID.

Returns depth * chunk_size results. Note: if no posts can be retrieved the cost is 1. See the start_cursor and depth query parameters below for information on how to manage pagination (fetch more posts).

API Pricing (per request): #returned_posts units

API usage examples

  • User does not exist:
    -> 0 posts returned.
    Cost: 1 unit

  • User is private:
    -> 0 posts returned.
    Cost: 1 unit

  • User exists and does not have posts:
    -> 0 posts returned.
    Cost: 1 unit

  • User exists, depth 5, chunk_size 10:
    -> 50 posts returned.
    Cost: 50 units

  • User exists, depth 5, chunk_size 10 and has only 15 posts:
    -> 15 posts returned.
    Cost: 15 units

  • User exists, depth 5, chunk_size 10 and has only 5 posts more recent than timestamp:
    -> 5 posts returned.
    Cost: 5 units


Try the API

query Parameters
user_id
required
integer (User Id) > -1
Example: user_id=18428658

ID of the user.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

oldest_timestamp
integer (Oldest Timestamp)
Example: oldest_timestamp=1666262030

This parameter is used as a stopping condition for fetching posts. If a post older than the provided oldest_timestamp is found, the system will stop fetching posts and return the results. For instance, if depth is 10, the system will aim to send 10 requests. However, if an oldest_timestamp is set, and we find a post which is older than the oldest_timestamp, the system will not send any more requests and return the results. Note: we do not filter out posts older than the provided oldest_timestamp before returning the results. Please do this filtering in your own integration if required.

chunk_size
integer (Chunk Size) [ 1 .. 20 ]
Default: 10
Example: chunk_size=10

The number of posts to fetch per depth. If alternative_method=False, the maximum allowed chunk_size is 20. If alternative_method=True, the maximum chunk_size is 12.

start_cursor
string (Start Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a last_cursor which can be used to retrieve the next page of results by sending it as the next start_cursor. If the last_cursor is not present in the response, it means that there are no more results to retrieve.

alternative_method
boolean (Alternative Method)
Default: false

If true, use a different method to fetch the user posts from the ID (this method returns at least 1 non pinned post when start_cursor is an empty string). The response JSON will be differ from the default method.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/posts"
params = {
  "user_id": 18428658,
  "depth": 1,
  "oldest_timestamp": 1666262030,
  "chunk_size": 10,
  "start_cursor": "",
  "alternative_method": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Basic Stats

Fetch basic user information from their user ID.

API Pricing (per request): 4 units


Try the API
query Parameters
user_id
required
integer (User Id) > -1
Example: user_id=18428658

ID of the user.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/basic-info"
params = {
  "user_id": 18428658,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

User Info

Fetch user info from their username.

API Pricing (per request): 3 units


Try the API
query Parameters
username
required
string (Username)
Example: username=daviddobrik

The user's username.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/info"
params = {
  "username": "daviddobrik",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Detailed Info

Fetch detailed user info from their username.

API Pricing (per request): 10 units


Try the API
query Parameters
username
required
string (Username) non-empty
Example: username=daviddobrik

The user's username.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/detailed-info"
params = {
  "username": "daviddobrik",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Follower Count

Fetch the number of followers from a user ID.

API Pricing (per request): 2 units


Try the API
query Parameters
user_id
required
integer (User Id) > -1
Example: user_id=18428658

ID of the user.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/followers"
params = {
  "user_id": 18428658,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

User Reels

Fetch the user's reels from their user ID.

Depth 1 returns 10 results, depth N returns N * 10 results. See the depth and cursor query parameters below for information on how to manage pagination (fetch more reels).

API Pricing (per request): #returned_reels units


Try the API

query Parameters
user_id
required
integer (User Id) > -1
Example: user_id=18428658

User ID.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

include_feed_video
boolean (Include Feed Video)
Default: true
Example: include_feed_video=true

If true, also includes videos posted in user feed.

oldest_timestamp
integer (Oldest Timestamp)
Example: oldest_timestamp=1666262030

This parameter is used as a stopping condition for fetching posts. If a post older than the provided oldest_timestamp is found, the system will stop fetching posts and return the results. For instance, if depth is 10, the system will aim to send 10 requests. However, if an oldest_timestamp is set, and we find a post which is older than the oldest_timestamp, the system will not send any more requests and return the results. Note: we do not filter out posts older than the provided oldest_timestamp before returning the results. Please do this filtering in your own integration if required.

start_cursor
string (Start Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next start_cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

chunk_size
integer (Chunk Size) > 2
Default: 10
Example: chunk_size=10

The number of reels to fetch per depth.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/reels"
params = {
  "user_id": 18428658,
  "depth": 1,
  "include_feed_video": True,
  "oldest_timestamp": 1666262030,
  "start_cursor": "",
  "chunk_size": 10,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Tagged Posts

Fetch posts for which the given user ID has been tagged.

Each call returns the 10 most recent posts where the user has been tagged. See the cursor query parameter below for information on how to manage pagination (fetch more posts).

API Pricing (per request): #returned_posts units


Try the API

query Parameters
user_id
required
integer (User Id) > -1
Example: user_id=325734299

User ID.

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

chunk_size
integer (Chunk Size) > 0
Default: 10
Example: chunk_size=10

Number of posts to fetch per request.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/user/tagged-posts"
params = {
  "user_id": 325734299,
  "cursor": "",
  "chunk_size": "10",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Info & Comments

Fetch post information and statistics from shortcode. Additionally, the 50 most recent comments in the post can be fetched.

API Pricing (per request): 2 + ceil(#comments_fetched / 5) units


Try the API
query Parameters
code
required
string (Code)
Example: code=CjDN1tzMIjR

Shortcode of the post.

n_comments_to_fetch
integer (N Comments To Fetch)
Default: 0

How many comments to fetch per post (max allowed is 50).

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/post/details"
params = {
  "code": "CjDN1tzMIjR",
  "n_comments_to_fetch": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Hashtag Posts

Fetch most recent posts containing hashtag. Each cursor returns approximately 30 posts.

ATTENTION: This API returns posts ordered by posting time OR the last time the caption was edited. If a post caption gets edited, the sorting order of this post will be in the timestamp when it got edited. Check the taken_at_timestamp field for the actual posting time. Therefore, in a chunk there might be posts whose timestamp is much older than the other posts returned in the response. This is due to the post caption being changed after the posting time.

The posts are returned similarly to what is shown at https://www.instagram.com/explore/tags/magic.

See the cursor query parameter below for information on how to manage pagination (fetch more posts).

API Pricing (per request): #returned_recent_posts units


Try the API

query Parameters
name
required
string (Name)
Example: name=magic

Hashtag to be searched (no # needed).

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

chunk_size
integer (Chunk Size) > 8
Default: 36
Example: chunk_size=36

The number of posts to fetch per request.

get_author_info
boolean (Get Author Info)
Default: false

Fetch more information about the owner of the post (username, profile pic url and followers). If true, 1 additional unit is charged per post.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/hashtag/posts"
params = {
  "name": "magic",
  "cursor": "",
  "chunk_size": "36",
  "get_author_info": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Music Posts

Fetch posts from a music ID.

See the cursor query parameter below for information on how to manage pagination (fetch more posts).

API Pricing (per request): #returned_posts units


Try the API

query Parameters
id
required
string (Id)
Example: id=3473785566185564

Music ID.

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/instagram/music/posts"
params = {
  "id": "3473785566185564",
  "cursor": "",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Youtube

Real-time Youtube data scraping API for publicly available data. Scrape Youtube videos, posts, users information and statistics, comments, hashtags, keyword and more.

Channel Detailed Info

Get detailed information for a specific Youtube channel from its ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

API Pricing (per request): 2 units


Try the API
query Parameters
browseId
required
string (Browseid) >= 4 characters
Example: browseId=UCnQghMm3Z164JFhScQYFTBw

Channel ID.

from_url
boolean (From Url)
Default: false

if true, the browseId needs to be a url like youtube.com/@... OR youtube.com/channel/... OR youtube.com/c/.... If True, 1 extra unit gets charged.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/detailed-info"
params = {
  "browseId": "UCnQghMm3Z164JFhScQYFTBw",
  "from_url": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Channel Videos

Fetch videos for a given channel from its ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

Depth 1 returns approx. 25 videos, Depth N returns approx. 25 * N videos.

API Pricing (per request): #returned_videos / 10 units

API usage examples

  • Depth 1:
    -> 22 videos returned.
    Cost: 3 units

  • Depth 5 but channel has only 20 videos:
    -> 20 videos returned.
    Cost: 2 units

  • Depth 50:
    -> 100 videos returned.
    Cost: 10 units

  • Depth 100:
    -> 2000 videos returned.
    Cost: 200 units


Try the API

query Parameters
browseId
required
string (Browseid) >= 4 characters
Example: browseId=UCnQghMm3Z164JFhScQYFTBw

Channel ID.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/videos"
params = {
  "browseId": "UCnQghMm3Z164JFhScQYFTBw",
  "depth": 1,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Channel Shorts

Fetch Youtube Shorts for a given channel from its ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

Depth 1 returns approx. 50 videos, Depth N returns approx. 50 * N videos.

API Pricing (per request): #returned_shorts / 10 units

API usage examples

  • Depth 1:
    -> 53 shorts returned.
    Cost: 6 units

  • Depth 5 but channel only has 20 shorts:
    -> 20 shorts returned.
    Cost: 2 units

  • Depth 10:
    -> 500 videos returned.
    Cost: 50 units

  • Depth 50:
    -> 2500 videos returned.
    Cost: 250 units


Try the API

query Parameters
browseId
required
string (Browseid) >= 4 characters
Example: browseId=UClAa0YLrW4MaIKOWaeZR9Xg

Channel ID.

depth
required
integer (Depth) > 0
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/shorts"
params = {
  "browseId": "UClAa0YLrW4MaIKOWaeZR9Xg",
  "depth": 1,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Video / Short Details

Fetch statistics for a Youtube short or video from its channel ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

API Pricing (per request): 1 unit


Try the API
query Parameters
id
required
string (Id) non-empty
Example: id=0nmRyN8gjrQ

Youtube short or video ID.

alternative_method
boolean (Alternative Method)
Default: false

If true, Uses a different method to fetch the statistics for the Youtube short or video. The response JSON will differ from the default method.

get_subscribers_count
boolean (Get Subscribers Count)
Default: false

If true, fetches the number of subscribers for the channel owner of the video. 1 additional unit is charged.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/get-short-stats"
params = {
  "id": "0nmRyN8gjrQ",
  "alternative_method": False,
  "get_subscribers_count": False,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Channel Subscriber Count

Fetch the number of subscribers for a channel from its ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

API Pricing (per request): 1 unit


Try the API
query Parameters
browseId
required
string (Browseid) >= 5 characters
Example: browseId=UCnQghMm3Z164JFhScQYFTBw

Channel ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/followers"
params = {
  "browseId": "UCnQghMm3Z164JFhScQYFTBw",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": "12.8K"
}

Channel Username To Id

Get the channel ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA) from the channel username (youtube.com/@MrBeast).

API Pricing (per request): 1 unit


Try the API
query Parameters
name
required
string (Name) non-empty
Example: name=daviddobrik

Channel username.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/name-to-id"
params = {
  "name": "daviddobrik",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": "UCmh5gdwCx6lN7gEC20leNVA"
}

Channel Id To Username

Get the channel username (youtube.com/@MrBeast) from the channel ID (youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA).

API Pricing (per request): 1 unit


Try the API
query Parameters
browseId
required
string (Browseid) >= 4 characters
Example: browseId=UCX6OQ3DkcsbYNE6H8uQQuVA

Channel ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/channel/id-to-name"
params = {
  "browseId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": "bhagatsisters"
}

Music Id To Shorts

Get shorts using a specific music ID.

You can find the ID by going to a short video on Youtube (e.g. https://www.youtube.com/shorts/iFBxUBF3NCI) and clicking on the music tile at the bottom right. This will take you to another page where you with a url something like 'https://www.youtube.com/source/XXXXXX/shorts?bp=XXXX'. The music ID is the part after 'bp='.

Alternatively you can find the music ID using the Video / Short Details endpoint. It will be in the response inside the url at 'soundMetadata.onTapCommand.innertubeCommand.commandMetadata.webCommandMetadata.url'.

Depth 1 returns approx. 15 videos, Depth N returns approx. 15 * N videos.

API Pricing (per request): #returned_shorts / 10 units


Try the API

query Parameters
id
required
string (Id) non-empty
Example: id=8gVfClISQwoLWmE4dElJdklVVXcSC1phOHRJSXZJVVV3GgtGR1BUQmZBdHdOUSIOCPClAxIICAwQgIHJpAMqChIICAwQgIHJpAMaC0ZHUFRCZkF0d05RKLDs0Pr0-qy5-AE%3D

Channel ID.

depth
integer (Depth) > 0
Default: 1
Example: depth=1

Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/music/id-to-shorts"
params = {
  "id": "8gVfClISQwoLWmE4dElJdklVVXcSC1phOHRJSXZJVVV3GgtGR1BUQmZBdHdOUSIOCPClAxIICAwQgIHJpAMqChIICAwQgIHJpAMaC0ZHUFRCZkF0d05RKLDs0Pr0-qy5-AE%3D",
  "depth": 1,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Video / Short Comments

Get comments for a specific Youtube video or short.

See the cursor query parameter below for information on how to manage pagination (fetch more comments).

API Pricing (per request): 2 units


Try the API

query Parameters
id
required
string (Id) non-empty
Example: id=cKkb5tperxc

video or short ID.

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/youtube/video/comments"
params = {
  "id": "cKkb5tperxc",
  "cursor": "",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Threads

Real-time Threads data scraping API for publicly available data. Scrape Threads videos, posts, users information and statistics, comments, hashtags, keyword and more.

Keyword Search

Fetch posts related to a certain keyword. The posts can be top or most recent.

NB: Threads returns only 10-20 posts at maximum per keyword. Run the API multiple times per day to get more posts.

API Pricing (per request): #returned_posts units


Try the API

query Parameters
name
required
string (Name)
Example: name=ferrari

Keyword to search.

sorting
string (Sorting)
Default: 0
Enum: "0" "1"

The posts returned are TOP if sorting=0, or most RECENT if sorting=1

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/threads/keyword/search"
params = {
  "name": "ferrari",
  "sorting": 0,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": [
    ]
}

User Info

Get user detailed information using the user ID.

API Pricing (per request): 4 units


Try the API
query Parameters
id
required
integer (Id)
Example: id=195178788

User ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/threads/user/info"
params = {
  "id": 195178788,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

User Posts

Fetch most recent posts for a user using the user ID.

NB: Threads returns at maximum the 20-30 most recent posts for a user.

API Pricing (per request): #returned_posts units


Try the API

query Parameters
id
required
integer (Id)
Example: id=195178788

User ID.

chunk_size
integer (Chunk Size) > 0
Default: 10
Example: chunk_size=10

How many posts to fetch with the request.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/threads/user/posts"
params = {
  "id": 195178788,
  "chunk_size": 10,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Replies

Fetch the replies to a post using its ID.

NB: Threads returns at maximum the 20-30 most popular replies to a posts.

API Pricing (per request): #returned_replies units


Try the API

query Parameters
id
required
integer (Id)
Example: id=3462070596773592600

Post ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/threads/post/replies"
params = {
  "id": 3462070596773592457,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Reddit

Real-time Reddit data scraping API for publicly available data. Scrape Reddit videos, posts, users information and statistics, comments, hashtags, keyword and more.

Subreddit Posts

Fetch posts from a given subreddit with chosen filters.

See the cursor query parameter below for information on how to manage pagination (fetch more posts).

API Pricing (per request): 2 units


Try the API

query Parameters
name
required
string (Name)
Example: name=SkincareAddiction

Subreddit to be searched.

sort
required
string (SubredditSorting)
Enum: "hot" "new" "top" "rising"
Example: sort=new

Type of posts to fetch.

period
required
string (Period)
Enum: "hour" "day" "week" "month" "year" "all"
Example: period=hour

ATTENTION: The time filter applies only to sort type 'top'.

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/reddit/subreddit/posts"
params = {
  "name": "SkincareAddiction",
  "sort": "new",
  "period": "hour",
  "cursor": "",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}

Post Comments

Fetch comments from a given post.

See the cursor query parameter below for information on how to manage pagination (fetch more comments).

API Pricing (per request): 3 units


Try the API

query Parameters
id
required
string (Id)
Example: id=t3_176958t

Post ID.

cursor
string (Cursor)
Default: ""

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/reddit/post/comments"
params = {
  "id": "t3_176958t",
  "cursor": "",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Twitch

Real-time Twitch data scraping API for publicly available data. Scrape Twitch videos, posts, users information and statistics, comments, hashtags, keyword and more.

User Followers

Fetch the number of followers for the given channel.

API Pricing (per request): 1 unit


Try the API
query Parameters
username
required
string (Username)
Example: username=hmatttv

Name of the channel.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/twitch/user/followers"
params = {
  "username": "hmatttv",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": 124198
}

Twitter

Real-time Twitter data scraping API for publicly available data. Scrape Twitter videos, posts, users information and statistics, comments, hashtags, keyword and more.

User Info

Get information of a user.

API Pricing (per request): 2 units


Try the API
query Parameters
name
required
string (Name)
Example: name=elonmusk

Username.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/twitter/user/info"
params = {
  "name": "elonmusk",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

User Tweets

Fetch tweets for a user. N.B. = The tweets are returned in the order decided by Twitter (not chronological).

API Pricing (per request): 4 units


Try the API
query Parameters
id
required
integer (Id)
Example: id=50393960

User ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/twitter/user/tweets"
params = {
  "id": 50393960,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Post Info

Get information and statistics from a Tweet from its ID.

API Pricing (per request): 2 units


Try the API
query Parameters
id
required
integer (Id)
Example: id=1694791112567967700

Tweet ID.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/twitter/post/info"
params = {
  "id": 1694791112567967849,
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{
  • "data": {
    }
}

Snapchat

Real-time Snapchat data scraping API for publicly available data. Scrape Snapchat videos, posts, users information and statistics, comments, hashtags, keyword and more.

User Info

Get information of a user.

API Pricing (per request): 3 units


Try the API
query Parameters
name
required
string (Name)
Example: name=daviddobrik

Username.

token
required
string (Token)
Example: token=YOUR_TOKEN_HERE

Private token assigned to each client to access the APIs.

Responses

Request samples

import requests

root = "https://ensembledata.com/apis"
endpoint = "/snapchat/user/info"
params = {
  "name": "daviddobrik",
  "token": "YOUR-TOKEN-HERE"
}

res = requests.get(root+endpoint, params=params)
print(res.json())

Response samples

Content type
application/json
{}