
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Check out the API docs to see which endpoints are available for each social media and for detailed descriptions of their parameters and functionality.
Install the package with pip as you would any other python package.
pip install ensembledata-python
Register to get your free API token.
from ensembledata.api import EDClient
client = EDClient("API-TOKEN")
result = client.tiktok.user_info_from_username("daviddobrik")
print("Data: ", result.data)
print("Units charged:", result.units_charged)
# Other Examples:
#
# result = client.instagram.user_info(username="daviddobrik")
# result = client.youtube.channel_subscribers(channel_id="UCnQghMm3Z164JFhScQYFTBw")
Explore the extensive usage documentation for the TikTok API.
Explore the extensive usage documentation for the Instagram API.
Explore more extensive usage documentation for the Youtube API.
If you find that one of the endpoints from our API docs is not yet available in this package, you can use the EDClient.request
method to specify the endpoint manually in the meantime.
from ensembledata.api import EDClient
client = EDClient("API-TOKEN")
result = client.request("/instagram/[example]", params={"foo": "...", "bar": "..."})
If you find that one the parameters to an existing endpoint is missing, you can still send this parameter via the extra_params
dictionary which is available on all endpoint methods. See the example below:
from ensembledata.api import EDClient
client = EDClient("API-TOKEN")
result = client.instagram.user_info(username="...", extra_params={"baz": "..."})
In the API docs, each endpoint lists a handful of possible errors the API may respond with. You can handle these errors by catching the EDError
exception.
from ensembledata.api import EDClient, EDError
client = EDClient("API-TOKEN")
try:
result = client.tiktok.user_info_from_username("daviddobrik")
except EDError as e:
# Rate limit exceeded...
if e.status_code == 429:
print(e.detail)
# Subscription expired...
if e.status_code == 493:
print(e.detail)
except Exception as e:
# Some other error occurred, unrelated to the EnsembleData API
# E.g. httpx.RequestError, json.JSONDecodeError
pass
This package provides an asynchronous client, EDAsyncClient
, which will give you access to async versions of all the same methods that can be found on the EDClient
.
import asyncio
from ensembledata.api import EDAsyncClient
async def main():
client = EDAsyncClient("API-TOKEN")
result = await client.tiktok.user_info_from_username("daviddobrik")
if __name__ == "__main__":
asyncio.run(main())
The package uses type hints, and is type checked with the latest version of mypy
. If you experience any type checking related issues with the package, please let us know by creating an issue.
FAQs
Python bindings for the EnsembleData API
We found that ensembledata-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.