Skip to content

AayushGithub/thread-count

Repository files navigation

Thread Count

Thread Count is a service that allows you to generate custom status badges displaying Meta's Threads.net follower counts. You can customize the badge color, style, width, scale, label color, and more. The generated badges are in SVG format and can be easily embedded into your markdown files, websites, or any other platform that supports SVG images.

Default Badge

Motivation

The Thread Count API was created to provide an easy way for users to showcase their Threads.net follower counts using customizable status badges. Whether you want to display your follower count on your personal blog, project documentation, or social media profiles, this API enables you to generate visually appealing badges that suit your preferences.

Technologies and Dependencies

The Thread Count API is built using the following technologies:

  • Node.js: A JavaScript runtime environment.
  • Express.js: A fast and minimalist web framework for Node.js.
  • Threads Unofficial API: A reverse-engineered Node.js/TypeScript client for Threads.
  • Badgen: A library for generating SVG badges.
  • Gradient Badge: A library for applying gradients to badges.
  • Swagger UI Express: A middleware for rendering Swagger UI documentation.

How to Use

  1. Clone this repository to your local machine.
  2. Navigate to the thread-count directory.
  3. Install the dependencies by running npm install.
  4. Start the server by running npm start.
  5. The bot will be accessible at http://localhost:{PORT} (default port is 3000).
  6. Access the /thread-count/:username endpoint to trigger the bot and generate a badge for the specified username.

Base URL

The base URL for the Thread Count API is https://thread-count.vercel.app.

Get a Badge

To get a badge displaying an Instagram follower count, make a GET request to the following endpoint:

/thread-count/:username

Replace :username with the desired Instagram username.

Parameters

The /thread-count/:username endpoint supports the following query parameters:

  • color (optional): The color of the badge. Default: blue.
  • style (optional): The style of the badge. Default: flat.
  • width (optional): The width of the badge icon. Default: 13.
  • scale (optional): The scale of the badge. Default: 1.
  • labelColor (optional): The color of the badge label. Default: black.
  • icon (optional): Whether to include the badge icon. Default: true.
  • label (optional): The label text for the badge. Default: Thread Count.
  • gradient (optional): Whether to apply a gradient to the badge. Default: true.

Example Badges

To use a badge in a markdown file, simply copy the markdown code and paste it into your file.

<a href="https://www.threads.net/{your-username}">
    <img src="https://thread-count.vercel.app/thread-count/{your-username}" alt="My Thread Count">
</a>

OR

![https://www.threads.net/{your-username}](https://thread-count.vercel.app/thread-count/{your-username})

Color

You can use any valid HEX color or pick from a predefined set of named colors (blue is the default if gradients is disabled).

color demo
blue (default) blue Badge
green Green Badge
yellow Yellow Badge
orange Orange Badge
red Red Badge
pink Pink Badge
purple Purple Badge
4B0082 (Hex code for Indigo) Indigo Badge

Style

You can use any valid style or pick from a predefined set of styles (flat is the default).

style demo
flat (default) Flat Badge
classic Classic Badge

Width

You can use any valid width or pick from a predefined set of widths (13 is the default).

width demo
13 (default) 13px Badge
20 20px Badge
30 30px Badge

Scale

You can use any valid scale or pick from a predefined set of scales (1 is the default) (does not apply well in GitHub READMEs as image tags, only as link)

scale demo
1 (default) https://www.threads.net/@zuck
1.5 https://www.threads.net/@zuck
2 https://www.threads.net/@zuck

Label Color

You can use any valid HEX color or pick from a predefined set of named colors (black is the default).

labelColor demo
black (default) Black Badge
white White Badge
gray Gray Badge
red Red Badge
green Green Badge

Icon

You can enable or disable the badge icon (true is the default).

icon demo
true (default) Default Badge
false No Icon Badge

Label

You can use any valid label or pick from a predefined set of labels (Thread Count is the default).

label demo
Thread Count (default) Default Badge
Follower Count Follower Count Badge
Followers Followers Badge

Gradient

You can enable or disable the badge gradient (true is the default).

gradient demo
true (default) Default Badge
false No Gradient Badge

Credits

About

Custom status badges for Threads.net follower counts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published