Overview
TheSocialAnalyzer class is the core Python API for Social Analyzer. It provides programmatic access to all username search and analysis functionality.
Installation
Class Import
Class Initialization
Constructor
boolean
default:"false"
Suppress all console output when
True. Useful for library integration and background tasks.Basic Initialization
Instance Attributes
After initialization, the class has the following attributes:Core Attributes
list
List of all available website definitions loaded from
sites.json. Each entry contains URL patterns, detection rules, and metadata.Shared detection patterns used across multiple websites
list
Generic detection rules applied when site-specific rules aren’t available
Configuration Attributes
boolean
default:"false"
Whether to suppress console output
integer
default:"15"
Number of concurrent worker threads for parallel website checking
integer/None
default:"None"
Delay in seconds between requests.
None means random delay (0.01-0.99s)boolean
default:"true"
Web Application Firewall detection/bypass mode
dict
HTTP headers sent with each request
Logging Attributes
Logger
Python logging instance for the class
string
default:"''"
Directory for log files (when logging is enabled)
Screenshots Attributes
boolean/None
default:"None"
Whether to capture screenshots of detected profiles
string/None
default:"None"
Directory to save captured screenshots
Internal Attributes
string
Path to
sites.json data filestring
Path to
languages.json data filedict/None
Loaded language definitions
dict/None
Raw sites data loaded from JSON
Regex Pattern Attributes
Pattern
Regex for detecting captcha and error pages
Pattern
Regex for detecting error page titles
Pattern
Regex for filtering out meta tags
Pattern
Regex for parsing top website numbers
Usage Patterns
Basic Setup
Silent Mode for Libraries
Custom Configuration
With Screenshots
List All Websites
Method Categories
TheSocialAnalyzer class provides several categories of methods:
Execution Methods
run_as_object()- Main method for programmatic usagerun_as_cli()- Parse command-line arguments and executecheck_user_cli()- Core CLI logic execution
Search Methods
find_username_normal()- Main username search using ThreadPoolExecutorfetch_url()- Check individual website for username
Initialization Methods
init_logic()- Load detection data and initializeinit_detections()- Initialize detection rulesload_file()- Load JSON data files
Utility Methods
list_all_websites()- Display all available websitesget_website()- Extract domain from URLsearch_and_change()- Update website entrytop_websites()- Select top N websitesdelete_keys()- Remove specified keys from objectclean_up_item()- Filter profile fieldsget_language_by_guessing()- Detect language from textget_language_by_parsing()- Detect language from HTMLcheck_errors()- Error checking decorator
Logging Methods
setup_logger()- Configure logging
Advanced Configuration
Custom Detection Rules
Error Handling
Thread Safety
Performance Considerations
Worker Count
The default worker count is 15. Adjust based on your system and network:Timeout Settings
Next Steps
Python Methods
Detailed documentation of all class methods
CLI Reference
Command-line interface documentation
Output Formats
Understanding result structures
Web Endpoints
Express web API reference