DEV Community

SEO - NT Tech Innovation
SEO - NT Tech Innovation

Posted on AI-assisted

Validating Social Media Links Before Placing an SMM Order: Regex Notes for TikTok, Facebook and YouTube

The most common reason an SMM order fails is not the provider. It is the link. A private profile, a share URL with tracking junk, or a link to the wrong post. If you build a small reseller site, validating links before you call the panel API saves refunds and support chats.

Normalize first

  • Trim whitespace and strip everything after ? unless the platform needs it (YouTube does).
  • Expand short links (vt.tiktok.com, fb.watch, youtu.be) by following redirects server-side.
  • Lowercase the host, never the path.

Patterns that cover most orders

import re

PATTERNS = {
    "tiktok_video":   re.compile(r"^https://(www\.)?tiktok\.com/@[\w.]+/video/\d+$"),
    "tiktok_profile": re.compile(r"^https://(www\.)?tiktok\.com/@[\w.]+/?$"),
    "fb_page":        re.compile(r"^https://(www\.|m\.)?facebook\.com/[\w.\-]+/?$"),
    "yt_video":       re.compile(r"^https://(www\.)?youtube\.com/(watch\?v=[\w-]{11}|shorts/[\w-]{11})$"),
}

def classify(url: str) -> str | None:
    for name, rx in PATTERNS.items():
        if rx.match(url):
            return name
    return None
Enter fullscreen mode Exit fullscreen mode

Match the link type to the service

  • A "TikTok views" service needs tiktok_video, not a profile link.
  • A "Facebook Page likes" service needs a Page, not a personal profile or a post.
  • YouTube Shorts and normal videos often have separate services.

Reject the form with a clear message instead of sending a bad order.

Things regex cannot check

  • Whether the account is public.
  • Whether the post still exists.
  • Whether the region allows the service.

For those, show a short checklist next to the order button.

Context

I put this together while looking at peso-priced TikTok services and the honest notes in this buy TikTok views Philippines guide, which spends a lot of words on exactly these link mistakes. If you are wiring up a reseller site, the BoostingPH API page shows the standard request format these checks sit in front of.

Written by MD Fozla Rabbi, SEO Specialist.

Top comments (0)