Skip to main content

A package to collect TikTok posts by hashtag

Project description

TikTok Hashtag Collector

A Python package to collect TikTok posts by hashtag using the RapidAPI TikTok API.

Installation

pip install tiktok-hashtag-collector

Usage

from tiktok_hashtag_collector import TiktokHashtagCollector

# Initialize the collector with your RapidAPI key
collector = TiktokHashtagCollector(
    api_key="YOUR_RAPIDAPI_KEY",  # Required: Your RapidAPI key
    country_code="US",            # Optional: Default is "US"
    max_post_by_hashtag=100,      # Optional: Default is 100
    max_hashtag_post_retry=3,     # Optional: Default is 3
    max_profile_retry=3           # Optional: Default is 3
)

# Collect posts for a hashtag
df = collector.collect_posts_by_hashtag("python")

# The DataFrame will contain the following columns:
# - search_method
# - input_kw_hst
# - post_id
# - post_link
# - caption
# - hashtag
# - hashtags
# - created_date
# - num_view
# - num_like
# - num_comment
# - num_share
# - target_country
# - user_id
# - username
# - bio
# - full_name
# - display_url
# - taken_at_timestamp

Requirements

  • Python 3.6+
  • requests
  • pandas
  • boto3

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

tiktok-hashtag-collector-0.1.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiktok_hashtag_collector-0.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file tiktok-hashtag-collector-0.1.2.tar.gz.

File metadata

File hashes

Hashes for tiktok-hashtag-collector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6fab69e6727c4ec591f05616c14692efbaff833e01582c1eb45056d0e01ff218
MD5 c3931c953a7b8244fc8af1929914846c
BLAKE2b-256 f2cd5ace97a09de17f5524cd2fab66e82ad5b6d71e9265c66b0d77ecca4583ac

See more details on using hashes here.

File details

Details for the file tiktok_hashtag_collector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tiktok_hashtag_collector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e51dd2940b904e3d992a2ff95731af1daa85c3362ee6e31b446293790013f01
MD5 292b793653c88e07bc6e718011a4fda9
BLAKE2b-256 d99418a3dfab7d366bcb4f36448079adbe2887850c71896948b978c404176fff

See more details on using hashes here.

Supported by

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