Skip to main content

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

Project description

socialscan

Build Status 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 ✔️
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 also cannot be extended to email addresses or platforms which don't use traditional profile pages.

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.

Executing single queries:

import asyncio

from socialscan.util import Platforms, query_without_checkers

result = asyncio.run(query_without_checkers(Platforms.GITHUB, "username1"))
print(f"Success: {result.success}, Valid: {result.valid}, Available: {result.available}")

Executing multiple queries concurrently requires a bit more setup:

import asyncio
import aiohttp
from socialscan.util import Platforms, init_checkers, query

async def execute_queries():
    async with aiohttp.ClientSession() as session:
        checkers = init_checkers(session)
        platforms = [Platforms.GITHUB, Platforms.LASTFM]
        queries = ["username1", "email2@gmail.com", "email3@me.com"]
        query_tasks = [query(p, q, checkers) for q in queries for p in platforms]
        results = await asyncio.gather(*query_tasks)
        for result in results:
            print(f"{result.query} on {result.platform.name}: Success: {result.success}, Valid: {result.valid}, Available: {result.available}")

asyncio.run(execute_queries())

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-0.1.1.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

socialscan-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: socialscan-0.1.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for socialscan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 aea7871de8fcc9623d2e6d1976d9f1f49f3c939033e3438d46c2471061fae636
MD5 a6058c00fb997bffe5815afc0e345e71
BLAKE2b-256 7c874de37b3d31885efdc62c098e424aa05b520756e5a406de538641b7a773f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: socialscan-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for socialscan-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b09719c6728cb82c411b3ef5e2e85b1fd5031287bfc5c8b19f5f1e59836138c7
MD5 b59dbb616b6eb6ead94ee4fa945baf85
BLAKE2b-256 9fd5aa4552292dacb4b7e64646607fd342626316db435cd01aff016ea336f22a

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