Skip to main content

No project description provided

Project description

SPARTA TikTok API

Linting Status Test Status Build Status Python Version License Checked with mypy

Welcome to the official GitHub repository for the SPARTA TikTok API, a powerful Python implementation to interact with TikTok's Research API in a robust and efficient manner.

🚀 Features

  • Methods for gathering video metadata, users and more.
  • Asynchronous API calls support.
  • Efficient error handling.
  • Comprehensive documentation with usage examples.

📦 Installation

We recommend using Poetry for managing the project dependencies. If you don't have Poetry installed, check their official documentation for guidance.

To install the SPARTA TikTok API via Poetry:

poetry add sparta-tiktokapi

or to install it via pip:

pip3 install sparta-tiktokapi

📝 Quick Start

Here's a simple example to get you started:

from datetime import date
from sparta.tiktokapi.access import create_bearer_token
from sparta.tiktokapi.videos.videos import query_videos

client_key = "xxxxxxxxxxx"
client_secret = "xxxxxxxxxxx"

bearer_token = create_bearer_token(client_key, client_secret)
query = {"or": [{"operation": "IN", "field_name": "username", "field_values": ["@tiktok"]}]}
start = date(2023, 1, 1)
end = date(2023, 1, 31)

async for video in query_videos(bearer_token, query, start, end, max_count=100):
    print(video)

For in-depth methods and examples, consult our official documentation.

🛠 Development & Contribution

Clone the Repo:

git clone https://github.com/UnibwSparta/tiktokapi.git
cd tiktokapi

Install Dependencies:

poetry install

Submit Your Changes: Make your improvements and propose a Pull Request!

🧪 Testing

Tests are powered by pytest. Execute tests with:

poetry run pytest tests/

❓ Support & Feedback

Issues? Feedback? Use the GitHub issue tracker.

📜 License

MIT License. View LICENSE for details.

Project SPARTA

SPARTA is an interdisciplinary research project at the UniBw M. The Chair of Political Science is responsible for managing the project. The project is funded by dtec.bw (Digitalization and Technology Research Center of the Bundeswehr). dtec.bw is funded by the European Union - NextGenerationEU.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparta_tiktokapi-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

sparta_tiktokapi-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file sparta_tiktokapi-0.1.1.tar.gz.

File metadata

  • Download URL: sparta_tiktokapi-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for sparta_tiktokapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ecd57266faaf5ddbb11225dc40263025d592b6c57475d64337684cbc6e1e476
MD5 2bc5e4008361ffb148cf7e9d28fc35c3
BLAKE2b-256 11d4c1cd3ac432584e228ae8e2762b2c1bea15a7a2e8bca54bd8c2d41b382601

See more details on using hashes here.

File details

Details for the file sparta_tiktokapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sparta_tiktokapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23557cfd26a06a885769eb897fc3c9df80846a547638c857a3a94c45921b8b97
MD5 607ce80d2f4ea88a9b06c7c029bcc055
BLAKE2b-256 89b5ed9b64ec2c8cb325a9ba68860ad4826afe79b3973b511a41e9303209e5db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page