GoogleDorking

Setup and Authentication

Methods for configuring the Google Custom Search API key, search engine ID, project settings, and credentials.

Methods for configuring the Google Custom Search API key, search engine ID, project settings, and credentials.

WithApiKey sets the Google Custom Search JSON API key. WithEngineId sets the Custom Search Engine (CSE) ID. WithProjectId and WithProjectName associate a Google Cloud project. WithCredentials supplies OAuth credentials as an alternative to an API key. GenerateApiKey creates a new API key for the current project and returns it via an out string. IsValidApiKeyFormat is a static method that validates whether a string matches the expected API key format.

TIP

Create a Custom Search Engine at cse.google.com and get an API key from the Google Cloud Console. The Engine ID (cx) appears in the CSE control panel. WithResultsPerPageUpTo10 limits results - the maximum the Google Custom Search API allows per request is 10.

Examples

GPAL Fluent: High-level fluent C# API

//WithApiKey and WithEngineId are required before any search call. Store the configured dorking object with ToGPALObject() when running multiple searches with the same configuration.

// Basic setup with API key and engine ID var dorking = GPAL.GoogleDorking .WithApiKey("AIzaSyD...") .WithEngineId("017576662512468239146:omuauf_lfve") .ToGPALObject(); // Generate a new API key string newKey; GPAL.GoogleDorking .WithProjectId("my-gcp-project") .WithCredentials(googleCreds) .GenerateApiKey(out newKey);