Skip to main content

CLI and library for checking email address and username usage on online platforms

Project description

socialscan

Build Status Downloads MIT license Python 3.7+

socialscan offers accurate and fast checks for email address and username usage on online platforms.

Given an email address or username, socialscan returns whether it is available, taken or invalid on online platforms. Its speed also makes it suitable for bulk queries involving hundreds of usernames and email addresses.

The following platforms are currently supported:

Username Email
Instagram ✔️ ✔️
Twitter ✔️ ✔️
GitHub ✔️ ✔️
Tumblr ✔️ ✔️
Lastfm ✔️ ✔️
Snapchat ✔️
GitLab ✔️
Reddit ✔️
Yahoo ✔️
Pinterest ✔️
Spotify ✔️

Background

Other similar tools check username availability by requesting the profile page of the username in question and based on information like the HTTP status code or error text on the requested page, determine whether a username is already taken. This is a naive approach that fails in the following cases:

  • Reserved keywords: Most platforms have a set of keywords that they don't allow to be used in usernames
    (A simple test: try checking reserved words like 'admin' or 'home' or 'root' and see if other services mark them as available)

  • Deleted/banned accounts: Deleted/banned account usernames tend to be unavailable even though the profile pages might not exist

Therefore, these tools tend to come up with false positives and negatives. This method of checking is also dependent on platforms having web-based profile pages and cannot be extended to email addresses.

socialscan aims to plug these gaps.

Features

  1. 100% accuracy: Rather than scanning profile pages, socialscan queries the registration servers of the platforms directly, retrieving the appropriate CSRF tokens, headers, and cookies. This eliminates all false positives/negatives, ensuring that results are accurate.

  2. Speed: socialscan uses asyncio along with aiohttp to conduct all queries concurrently, resulting in very quick searching even with bulk queries.

Installation

pip

> pip install socialscan

Install from source

> git clone https://github.com/iojw/socialscan.git  
> cd socialscan  
> pip install .

Usage

usage: socialscan [list of usernames/email addresses to check]

optional arguments:
  -h, --help            show this help message and exit
  --platforms [platform [platform ...]], -p [platform [platform ...]]
                        list of platforms to query (default: all platforms)
  --view-by {platform,query}
                        view results sorted by platform or by query (default:
                        query)
  --available-only, -a  only print usernames/email addresses that are
                        available and not in use
  --cache-tokens, -c    cache tokens for platforms requiring more than one
                        HTTP request (Snapchat, GitHub, Instagram. Lastfm &
                        Tumblr), reducing total number of requests sent
  --input input.txt, -i input.txt
                        file containg list of queries to execute
  --proxy-list proxy_list.txt
                        file containing list of HTTP proxy servers to execute
                        queries with
  --verbose, -v         show query responses as they are received
  --version             show program's version number and exit

As a library

socialscan can also be imported into existing code and used as a library.

v1.0.0 introduces the async method execute_queries and the corresponding synchronous wrapper sync_execute_queries that takes a list of queries and optional list of platforms and proxies, executing all queries concurrently. The method then returns a list of results in the same order.

from socialscan.util import Platforms, sync_execute_queries

queries = ["username1", "email2@gmail.com", "mail42@me.com"]
platforms = [Platforms.GITHUB, Platforms.LASTFM]
results = sync_execute_queries(queries, platforms)
for result in results:
    print(f"{result.query} on {result.platform}: {result.message} (Success: {result.success}, Valid: {result.valid}, Available: {result.available})")

Output:

username1 on GitHub: Username is already taken (Success: True, Valid: True, Available: False)
username1 on Lastfm: Sorry, this username isn't available. (Success: True, Valid: True, Available: False)
email2@gmail.com on GitHub: Available (Success: True, Valid: True, Available: True)
email2@gmail.com on Lastfm: Sorry, that email address is already registered to another account. (Success: True, Valid: True, Available: False)
mail42@me.com on GitHub: Available (Success: True, Valid: True, Available: True)
mail42@me.com on Lastfm: Looking good! (Success: True, Valid: True, Available: True)

Contributing

Errors, suggestions or want a site added? Submit an issue.

PRs are always welcome 🙂

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socialscan-1.1.4.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

socialscan-1.1.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file socialscan-1.1.4.tar.gz.

File metadata

  • Download URL: socialscan-1.1.4.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1

File hashes

Hashes for socialscan-1.1.4.tar.gz
Algorithm Hash digest
SHA256 7fd6c0babdaf8d1c67ab7bfdd215d669fb267f9f11b20b30749404929ccca38c
MD5 972ed36cbb36edb0b667b3b2e589aeef
BLAKE2b-256 2992f542e98b8defae23ff45477f8eee750adadb6ab74f7acb3ab73e1e0c8784

See more details on using hashes here.

File details

Details for the file socialscan-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: socialscan-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1

File hashes

Hashes for socialscan-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5d5479a540630e3aac35f5564ca0a97f430c8d1bfdf01fe7b4e0b1f546787a32
MD5 813c402c5aa571f8df7c67887ebf64dd
BLAKE2b-256 868d4ddb057580e9dc66e92e3dab933c4fde55ce2c729bf1b9b01e10d2a0336b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page