Socials
Social Account Detection and Extraction for Python
- Free software: GNU General Public License v3
- Documentation: https://socials.readthedocs.io
- Source: https://github.com/lorey/socials
Features
- Detect and extract URLs of social accounts: throw in URLs, get back URLs of social media profiles by type.
- Supports Facebook, Twitter, LinkedIn, GitHub, Instagram, YouTube, and email addresses.
Installation
pip install socials
Or with uv:
uv add socials
Usage
Python API
import socials
hrefs = [
"https://facebook.com/peterparker",
"https://techcrunch.com",
"https://github.com/lorey",
]
# Get all matches grouped by platform
socials.extract(hrefs).get_matches_per_platform()
# {'facebook': ['https://facebook.com/peterparker'], 'github': ['https://github.com/lorey'], ...}
# Get matches for a specific platform
socials.extract(hrefs).get_matches_for_platform("github")
# ['https://github.com/lorey']
CLI
# Check which platform a URL belongs to
socials check https://github.com/lorey
# github
# Extract social URLs from a file
socials extract urls.txt
# Extract from stdin
echo "https://github.com/lorey" | socials extract
Socials API
There's also Socials API that allows you to use the functionality via REST. You can use a free online version, try it in the browser, or deploy it yourself.
Development
# Clone and install
git clone https://github.com/lorey/socials
cd socials
uv sync --extra dev
# Run tests
uv run pytest
# Run linting
uv run ruff check .
uv run mypy socials
# Format code
uv run ruff format .
Metadata
Release files for socials 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| socials-0.3.0.tar.gz | 74.9 kB | With provenance | Details for socials-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| socials-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for socials-0.3.0-py3-none-any.whl |
Total release size: 82.0 kB
Security for socials 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release files / socials-0.3.0.tar.gz
How to use checksums
f8cf692ddefe6a6d6ba3525d60c38357b8b2bb2d81a3a4080726bc3d76237d3fHow to use checksums
b5b316c6e6dcd2fdf3914a849844b13f8a79d1f20194b17b9d564710b53a5a22What is trusted publishing?
twine/6.1.0 CPython/3.13.7Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 30, 2025.
Transparency logIdentity
Workflow
Artifact
socials-0.3.0.tar.gzf8cf692ddefe6a6d6ba3525d60c38357b8b2bb2d81a3a4080726bc3d76237d3fVerifying attestations