
オンラインプラットフォーム上でのユーザー名とメールアドレスの使用状況を正確に照会するためのPythonライブラリ
socialscan は、オンラインプラットフォームにおけるメールアドレスとユーザー名の使用状況を 正確 かつ 高速 にチェックします。
メールアドレスまたはユーザー名を指定すると、socialscan はそのプラットフォーム上で利用可能か、既に使用されているか、無効かを返します。
socialscan を類似ツール(例:knowem.com、Namechk、Sherlock)と差別化する機能:
100% の正確性: socialscan のクエリ方式は、類似ツールでよく発生する偽陽性や偽陰性を排除し、結果が常に正確であることを保証します。
速度: socialscan は asyncio と aiohttp を使用してすべてのクエリを同時に実行し、数百のユーザー名やメールアドレスを含む一括クエリでも高速な検索を提供します。平均的なスペックとインターネット速度のテスト用コンピュータでは、100 件のクエリを約 4 秒で実行しました。
ライブラリ/CLI: socialscan は CLI で実行することも、既存のコードで使用するために Python ライブラリとしてインポートすることもできます。
メールサポート: socialscan はメールアドレスとユーザー名の両方のクエリをサポートしています。
現在サポートされているプラットフォーム:

他の類似ツールは、問題のユーザー名のプロフィールページをリクエストし、HTTP ステータスコードやリクエストされたページのエラーテキストなどの情報に基づいて、ユーザー名が既に使用されているかどうかを判断します。これは、以下の場合に失敗する単純なアプローチです。
予約キーワード:ほとんどのプラットフォームには、ユーザー名に使用できないキーワードのセットがあります(簡単なテスト:'admin' や 'home' や 'root' などの予約語をチェックして、他のサービスがそれらを利用可能とマークするかどうかを確認してみてください)。
削除/禁止されたアカウント:削除/禁止されたアカウントのユーザー名は、プロフィールページが存在しない場合でも、利用できない傾向があります。
そのため、これらのツールは偽陽性や偽陰性を生み出す傾向があります。また、このチェック方法はプラットフォームがウェブベースのプロフィールページを持っていることに依存しており、メールアドレスに拡張することはできません。
socialscan は、代わりにプラットフォームの登録サーバーに直接クエリを実行し、適切な CSRF トークン、ヘッダー、Cookie を取得することで、これらのギャップを埋めることを目的としています。
> pip install socialscan
> git clone https://github.com/iojw/socialscan.git
> cd socialscan
> pip install .
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
--show-urls display profile URLs for usernames on supported platforms
(profiles may not exist if usernames are reserved or belong to deleted/banned accounts)
--json json.txt output results in JSON format to the specified file
--version show program's version number and exit
socialscan は既存のコードにインポートしてライブラリとして使用することもできます。
v1.0.0 では、非同期メソッド execute_queries と、対応する同期ラッパー sync_execute_queries が導入されました。これはクエリのリストとオプションのプラットフォーム・プロキシのリストを受け取り、すべてのクエリを同時に実行します。メソッドは同じ順序で結果のリストを返します。
from socialscan.util import Platforms, sync_execute_queries
queries = ["username1", "[email protected]", "[email protected]"]
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)
[email protected] on GitHub: Available (Success: True, Valid: True, Available: True)
[email protected] on Lastfm: Sorry, that email address is already registered to another account. (Success: True, Valid: True, Available: False)
[email protected] on GitHub: Available (Success: True, Valid: True, Available: True)
[email protected] on Lastfm: Looking good! (Success: True, Valid: True, Available: True)
--input オプションを使用した一括クエリの場合、.txt ファイルの各行に 1 つのユーザー名/メールアドレスを記述します。
username1
[email protected]
username3
このツールが役に立ち、継続的な開発をサポートしたい場合は、こちらから寄付できます。ご支援ありがとうございます。
BTC: bc1qwrnukyc6xh9aygu5ps2geh8stmvagsj5u4v7j6
ETH: 0x45a0F91666391078eA521A6123559E49DAb1275f
エラー、提案、またはサイトを追加してほしい場合? Issue を送信 してください。
PR はいつでも歓迎します 🙂
PR を送信する前に、コードが pyproject.toml の設定を使用して black でフォーマットされていることを確認してください。
MPL 2.0
| ユーザー名 | メール |
|---|
| ✔️ | ✔️ | |
| ✔️ | ✔️ | |
| GitHub | ✔️ | ✔️ |
| Tumblr | ✔️ | ✔️ |
| Lastfm | ✔️ | ✔️ |
| Snapchat | ✔️ | |
| GitLab | ✔️ | |
| ✔️ | ||
| Yahoo | ✔️ | |
| ✔️ | ||
| Firefox | ✔️ |