DataForSEO SEO Data Modules in Open SEO: Complete Module Reference
Open SEO exposes seven distinct SEO data modules through its DataForSEO integration, including SERP scraping, Labs research tools, Lighthouse audits, backlink profiles, and keyword metrics, all accessible via a type-safe TypeScript client.
The every-app/open-seo repository provides a thin client wrapper around the DataForSEO API, organizing endpoints into logical modules that handle everything from real-time search results to billing classification. Each module resides in its own file under src/server/lib/dataforseo/ and builds upon a shared authentication layer implemented in core.ts.
Architecture of the DataForSEO Integration
All SEO data modules rely on the createDataforseoClient factory function defined in src/server/lib/dataforseo/client.ts. This client initializes connections using credentials from environment variables and exposes module-specific methods for accessing the DataForSEO API.
The underlying src/server/lib/dataforseo/core.ts file manages authentication, request signing, retry logic, and response envelope validation. This shared foundation ensures consistent error handling and type safety across all modules, whether fetching SERP data or running Lighthouse audits.
Available SEO Data Modules
SERP Module
Located in src/server/lib/dataforseo/serp.ts, the SERP module provides access to Google Search Engine Results Page data. This includes organic results, paid advertisements, local map packs, and news results.
The module wraps endpoints following the pattern GET /v3/serp/google/organic/task_post (and variants for ads, maps, and news). You access these through the client hierarchy: client.serp.google.organic.taskPost().
SERP Locations Module
The SERP Locations module in src/server/lib/dataforseo/serp-locations.ts handles location and language code lookups required by other APIs. It exposes helpers like fetchSerpLocationsForCountry that map human-readable location names to numeric codes used by DataForSEO.
This module primarily consumes the /v3/dataforseo_labs/locations_and_languages endpoint, returning structured data such as [{ code: 2840, name: 'United States' }, ...].
Labs Module
Defined in src/server/lib/dataforseo/labs.ts, the Labs module is a research-oriented collection containing eight distinct sub-modules for keyword and domain analysis:
- Related keywords –
/v3/dataforseo_labs/google/related_keywords/live - Keyword suggestions –
/v3/dataforseo_labs/google/keyword_suggestions/live - Keyword ideas –
/v3/dataforseo_labs/google/keyword_ideas/live - Domain rank overview –
/v3/dataforseo_labs/google/domain_rank_overview/live - Ranked keywords –
/v3/dataforseo_labs/google/ranked_keywords/live - Relevant pages –
/v3/dataforseo_labs/google/relevant_pages/live - Keyword overview –
/v3/dataforseo_labs/google/keyword_overview/live - SERP competitors –
/v3/dataforseo_labs/google/serp_competitors/live
Access these through client.labs.google methods such as relatedKeywordsLive() or domainRankOverviewLive().
Lighthouse Module
The Lighthouse module in src/server/lib/dataforseo/lighthouse.ts runs Google Lighthouse performance audits via the DataForSEO infrastructure. It wraps POST /v3/lighthouse/google/organic/task_post and returns performance, accessibility, best practices, and SEO scores.
The module exposes fetchLighthouseResult and similar helpers that abstract the asynchronous task-posting workflow into promise-based interfaces.
Backlinks Module
Located in src/server/lib/dataforseoBacklinksTarget.ts, the Backlinks module retrieves comprehensive backlink profiles and historic link data for any domain or URL. It targets the /v3/backlinks/profile/task_post endpoint through the dataforseoBacklinksTarget helper function.
This module provides overview statistics including referring domains, backlink counts, and authority scores.
Google Ads Keyword Metrics Module
The Google Ads Keyword Metrics module in src/server/lib/dataforseo/keyword-metrics.ts delivers advertising intelligence data. It exposes search volume, cost-per-click (CPC), competition levels, and trend data via GET /v3/google_ads/keyword_metrics/live.
This module is essential for PPC research and organic keyword valuation, accessible through dedicated methods in the client configuration.
Billing Classification Module
Found in src/server/lib/dataforseoBillingClassification.ts, the Billing Classification module maps DataForSEO API responses to internal billing features. This module enables accurate quota tracking and cost attribution by associating each API call with its corresponding billing category.
While not providing external SEO data directly, this module is critical for usage monitoring and cost management within the Open SEO platform.
Implementing the SEO Data Modules
Initialize the client and access any module using the following pattern:
import { createDataforseoClient } from '@/server/lib/dataforseo/client';
// Initialize with DataForSEO credentials
const client = createDataforseoClient({
username: process.env.DATAFORSEO_USERNAME!,
password: process.env.DATAFORSEO_PASSWORD!,
});
// SERP: Fetch organic results for "open source"
const serpResult = await client.serp.google.organic.taskPost({
keyword: 'open source',
locationCode: 2840, // United States
});
// Labs: Get related keywords
const related = await client.labs.google.relatedKeywordsLive({
keyword: 'open source',
locationCode: 2840,
});
// Lighthouse: Run performance audit
const lighthouse = await client.lighthouse.google.organic.taskPost({
url: 'https://github.com/every-app/open-seo',
});
// Backlinks: Fetch domain profile
const backlinks = await client.backlinks.profile.taskPost({
target: 'every-app.com',
});
For location lookups, use the dedicated helper directly:
import { fetchSerpLocationsForCountry } from '@/server/lib/dataforseo/serp-locations';
const locations = await fetchSerpLocationsForCountry('US');
console.log(locations); // [{ code: 2840, name: 'United States' }, ...]
Summary
- Seven modules provide comprehensive SEO data coverage: SERP, SERP Locations, Labs, Lighthouse, Backlinks, Google Ads Keyword Metrics, and Billing Classification.
- Type-safe client initialization occurs through
createDataforseoClientinsrc/server/lib/dataforseo/client.ts. - Shared infrastructure in
core.tshandles authentication, retries, and response validation for all modules. - Labs module contains eight research endpoints covering keyword discovery and competitive analysis.
- Billing Classification enables accurate cost tracking by mapping API responses to internal quota systems.
Frequently Asked Questions
What SEO data modules are available in the Open SEO DataForSEO integration?
Open SEO provides seven modules: SERP (search results), SERP Locations ( geographic targeting), Labs (keyword research), Lighthouse (performance audits), Backlinks (link profiles), Google Ads Keyword Metrics (PPC data), and Billing Classification (usage tracking). Each module corresponds to specific DataForSEO API endpoint groups and resides in dedicated files under src/server/lib/dataforseo/.
How does authentication work for DataForSEO modules in Open SEO?
Authentication is handled centrally in src/server/lib/dataforseo/core.ts. When you call createDataforseoClient with a username and password, the core module applies HTTP Basic Auth to all requests and manages request signing. This ensures all seven SEO data modules use consistent security credentials without requiring manual auth headers per request.
What endpoints are included in the Labs module?
The Labs module in src/server/lib/dataforseo/labs.ts wraps eight research endpoints: related keywords, keyword suggestions, keyword ideas, domain rank overview, ranked keywords, relevant pages, keyword overview, and SERP competitors. Each endpoint follows the pattern /v3/dataforseo_labs/google/{endpoint_name}/live and exposes competitor intelligence and keyword opportunity data.
How does the billing classification system track API usage?
The Billing Classification module in src/server/lib/dataforseoBillingClassification.ts intercepts DataForSEO task responses and maps them to internal billing features. This allows Open SEO to attribute costs to specific feature usage, track quota consumption across the SERP, Labs, and other modules, and provide accurate usage analytics for cost management.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →