PHPackages                             andreinocenti/social-media-url-id-extractor-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. andreinocenti/social-media-url-id-extractor-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andreinocenti/social-media-url-id-extractor-php
===============================================

Exctract the id from a Social Media URL

v1.0.7(9mo ago)117MITPHPPHP ^8.1

Since Jul 18Pushed 9mo agoCompare

[ Source](https://github.com/andreinocenti/social-media-url-id-extractor-php)[ Packagist](https://packagist.org/packages/andreinocenti/social-media-url-id-extractor-php)[ RSS](/packages/andreinocenti-social-media-url-id-extractor-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Social Media URL ID Extractor
=============================

[](#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
---------------

[](#-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
--------------

[](#-installation)

```
composer require andreinocenti/social-media-url-id-extractor-php

## Basic Usage

```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
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance58

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

8

Last Release

272d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d5b3ad27cc2ab495bd40b9837f085b35efd442cbd88ceac5971f273ecdd88a6?d=identicon)[andreinocenti](/maintainers/andreinocenti)

---

Top Contributors

[![andreinocenti](https://avatars.githubusercontent.com/u/39701679?v=4)](https://github.com/andreinocenti "andreinocenti (30 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/andreinocenti-social-media-url-id-extractor-php/health.svg)

```
[![Health](https://phpackages.com/badges/andreinocenti-social-media-url-id-extractor-php/health.svg)](https://phpackages.com/packages/andreinocenti-social-media-url-id-extractor-php)
```

###  Alternatives

[foxy/foxy

Fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer

177287.5k25](/packages/foxy-foxy)[elijaa/phpmemcacheadmin

Graphic stand-alone administration for memcached

2618.4k](/packages/elijaa-phpmemcacheadmin)[mateffy/laravel-introspect

Analyze Laravel codebases and find structured information about models, routes and other Laravel-specific things.

1698.7k2](/packages/mateffy-laravel-introspect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
