Download the PHP package andreinocenti/social-media-url-id-extractor-php without Composer
On this page you can find all versions of the php package andreinocenti/social-media-url-id-extractor-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andreinocenti/social-media-url-id-extractor-php
More information about andreinocenti/social-media-url-id-extractor-php
Files in andreinocenti/social-media-url-id-extractor-php
Package social-media-url-id-extractor-php
Short Description Exctract the id from a Social Media URL
License MIT
Informations about the package social-media-url-id-extractor-php
Social Media URL ID Extractor
Social Media URL ID Extractor is a lightweight, intuitive PHP package that automatically detects the provider and resource type from any social media URL and extracts the corresponding identifier (ID). No more writing complex regex or handling each platform manually—just pass the URL and receive back the ID.
🚀 Main Features
- Automatic provider detection: Identifies platforms like Instagram, Facebook, X (Twitter), YouTube, TikTok, LinkedIn, and more
- Resource type classification: Profiles, posts, videos, reels, tweets, playlists, pins, etc.
- Accurate ID extraction: Returns only the unique identifier (e.g.,
ABC123XYZ,1234567890) - Single, simple API:
$result = (new SocialMediaUrlIdExtractor())->extract(string $url) - Supports shortened URLs and UTM query parameters
- Extensible: Easily add new providers to support additional platforms
📦 Installation
php use AndreInocenti\SocialMediaUrlIdExtractor\SocialMediaUrlIdExtractor;
// Extract ID from a URL $result = (new SocialMediaUrlIdExtractor())->extract('https://www.instagram.com/p/ABC123XYZ/'); echo $result->id; // Outputs: ABC123XYZ echo $result->provider; // Outputs: Instagram echo $result->resourceType; // Outputs: post