Skip to main content

Overview

The SocialAnalyzer 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.
list
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 file
string
Path to languages.json data file
dict/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

The SocialAnalyzer class provides several categories of methods:

Execution Methods

  • run_as_object() - Main method for programmatic usage
  • run_as_cli() - Parse command-line arguments and execute
  • check_user_cli() - Core CLI logic execution

Search Methods

  • find_username_normal() - Main username search using ThreadPoolExecutor
  • fetch_url() - Check individual website for username

Initialization Methods

  • init_logic() - Load detection data and initialize
  • init_detections() - Initialize detection rules
  • load_file() - Load JSON data files

Utility Methods

  • list_all_websites() - Display all available websites
  • get_website() - Extract domain from URL
  • search_and_change() - Update website entry
  • top_websites() - Select top N websites
  • delete_keys() - Remove specified keys from object
  • clean_up_item() - Filter profile fields
  • get_language_by_guessing() - Detect language from text
  • get_language_by_parsing() - Detect language from HTML
  • check_errors() - Error checking decorator

Logging Methods

  • setup_logger() - Configure logging
See Python Methods for detailed documentation of each method.

Advanced Configuration

Custom Detection Rules

Error Handling


Thread Safety

The SocialAnalyzer class uses ThreadPoolExecutor internally but is not guaranteed to be thread-safe for external concurrent access. Create separate instances for each thread if needed.

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