GoogleDorking

Results

Method for retrieving search results as an IGPALGrid and static utility for validating API key format.

Method for retrieving search results as an IGPALGrid and static utility for validating API key format.

GetResults executes the configured search against the Google Custom Search API and populates the out IGPALGrid<string> with the results. Each row in the grid represents one search result, with columns for title, URL, snippet, and other metadata. IsValidApiKeyFormat is a static method - pass any string to check whether it conforms to the Google API key format before attempting a search.

Examples

GPAL Fluent: High-level fluent C# API

//GetResults populates the grid synchronously. The maximum results per call is 10 (Google Custom Search API limitation). Call GetResults multiple times with different page offsets to collect more than 10 results.

// Get results and iterate GPAL.GoogleDorking .WithApiKey("AIzaSyD...") .WithEngineId("cx-value") .SearchFor("GPAL automation") .GetResults(out var results); foreach (var row in results) { string title = row[0]; string url = row[1]; Console.WriteLine($"{title} - {url}"); } // Validate a key before use if (GoogleDorking.IsValidApiKeyFormat(apiKey)) { // proceed with search }