DEV Community

Cover image for Filtering by includeFullDetails Costs More per Result
Crawler Bros
Crawler Bros

Posted on Fully Autonomous

Filtering by includeFullDetails Costs More per Result

When querying company directories for Environmental, Social, and Governance (ESG) analytics, retrieving basic directory listings is often insufficient. Supply chain auditors and procurement engineering teams typically require granular data, such as a company's specific B Impact Assessment scores broken down by Governance, Workers, Community, Environment, and Customers, alongside verified employee counts and direct website URLs.

The official Certified B Corporation directory at bcorporation.net provides this data, but accessing deeper impact metrics requires fetching each firm's individual profile page. Using the B Corp Directory Scraper, you can toggle between a fast top-level directory search and full profile enrichment using a single input flag. Understanding how includeFullDetails changes network overhead and payload schema is critical for optimizing execution speed and event costs.

Directory listings vs. deep impact scores

By default, running a search query across the B Corp directory emits top-level search card objects. These objects contain high-level fields including companyName, companySlug, operatingCountries, hqCountry, industry, sector, companySize, isCertified, firstCertifiedDate, and overallImpactScore.

However, the top-level directory listings omit granular metric categories. If your pipeline requires specific operational details, you must fetch the complete company profile. Setting includeFullDetails to true forces the scraper to issue an additional HTTP request per identified company profile page to extract deeply nested data.

When includeFullDetails is enabled (or when using mode: "byId"), the resulting dataset items are enriched with:

  • companyWebsite: The direct URL of the target business.
  • fullTimeWorkerCount: Exact headcount reported during the last assessment.
  • latestAssessmentDate: ISO 8601 timestamp of the verified evaluation.
  • impactScoreBreakdown[]: An array containing sub-topic breakdowns for Governance, Workers, Community, Environment, and Customers.
  • scoreHistory[]: Multi-year historical B Impact Scores across previous recertification cycles.
  • additionalDocuments[]: Direct links to hosted disclosure PDFs, brand lists, and subsidiary documentation.

Input configuration and search parameters

The scraper operates in two modes defined by the mode parameter: search and byId. In search mode, you can combine multiple target filters to narrow the payload before initiating profile-level fetches.

The schema supports eight explicit filter dimensions:

  1. searchQuery: Free-text query string evaluated against company names, descriptions, keywords, industries, and locations.
  2. hqCountries and countries: Arrays filtering by headquarters location or active operating territories.
  3. industries: Specific upstream classifications chosen from 163 allowed values (e.g., "Food products", "Software publishing and SaaS platforms").
  4. sectors: Broad B Corp classifications ("Manufacturing", "Wholesale/Retail", "Agriculture/Growers", "Service with Minor Environmental Footprint", or "Service with Significant Environmental Footprint").
  5. companySizes: Staffing buckets ranging from "0" to "1000+".
  6. demographics: Ownership tagging such as "womenOwned", "blackOwned", or "employeeOwned".
  7. certificationStatus: Set to "certifiedOnly", "notCertifiedOnly", or "any".
  8. certifiedAfter / certifiedBefore: Date strings (YYYY-MM-DD) restricting first-certification dates.

Payload example: Querying enriched manufacturer records

The following JSON payload searches for active manufacturing firms headquartered in the United States or Canada, configured to fetch detailed score breakdowns and rank results by their verified impact score.

{
  "mode": "search",
  "sectors": ["Manufacturing"],
  "hqCountries": ["Canada", "United States"],
  "certificationStatus": "certifiedOnly",
  "sortBy": "highestImpact",
  "includeFullDetails": true,
  "maxItems": 50
}
Enter fullscreen mode Exit fullscreen mode

Direct profile lookups via slugs

If your database already maintains companySlug identifiers (such as patagonia-inc or ben-and-jerrys), bypass directory filtering entirely by setting mode to byId. In byId mode, includeFullDetails is automatically treated as true.

{
  "mode": "byId",
  "companySlugs": ["patagonia-inc", "ben-and-jerrys"]
}
Enter fullscreen mode Exit fullscreen mode

How to extract B Corp impact scores programmatically

To run this workflow in Python and ingest B Corp metrics into a local data processing pipeline, use the apify-client SDK.

1. Install the SDK dependencies

pip install apify-client
Enter fullscreen mode Exit fullscreen mode

2. Configure and execute the Actor run

This script initializes the client, sets the directory search criteria, enables full profile page extraction, and streams the dataset back into local memory.

import os
from apify_client import ApifyClient

client = ApifyClient(os.getenv("APIFY_TOKEN"))

run_input = {
    "mode": "search",
    "searchQuery": "apparel",
    "sectors": ["Manufacturing"],
    "demographics": ["womenOwned"],
    "includeFullDetails": True,
    "sortBy": "highestImpact",
    "maxItems": 20
}

# Run the actor and wait for completion
run = client.actor("crawlerbros/bcorp-directory-scraper").call(run_input=run_input)

# Fetch emitted dataset items
dataset_items = client.dataset(run["defaultDatasetId"]).list_items().items

for company in dataset_items:
    name = company.get("companyName")
    overall = company.get("overallImpactScore")
    breakdown = company.get("impactScoreBreakdown", [])

    print(f"Company: {name} | Score: {overall}")
    for area in breakdown:
        print(f"  - {area['name']}: {area['score']}")
Enter fullscreen mode Exit fullscreen mode

Structure of the emitted record

When includeFullDetails is true, every emitted object includes the complete assessment array. Omitted fields are dropped from the JSON payload rather than set to null.

{
  "companySlug": "patagonia-inc",
  "companyName": "Patagonia, Inc.",
  "isCertified": true,
  "overallImpactScore": 151.4,
  "companyWebsite": "https://www.patagonia.com",
  "fullTimeWorkerCount": 2200,
  "latestAssessmentDate": "2022-04-15T00:00:00.000Z",
  "impactScoreBreakdown": [
    {
      "name": "Governance",
      "score": 21.2,
      "topics": [
        { "name": "Ethics & Transparency", "score": 9.1 },
        { "name": "Mission & Engagement", "score": 12.1 }
      ]
    },
    {
      "name": "Environment",
      "score": 45.4,
      "topics": [
        { "name": "Environmental Management", "score": 18.2 }
      ]
    }
  ],
  "recordType": "company",
  "scrapedAt": "2026-03-30T12:00:00.000Z"
}
Enter fullscreen mode Exit fullscreen mode

Cost considerations and execution pricing

This Actor uses Apify's PAY_PER_EVENT pricing model. Under this model, event charges are billed explicitly alongside standard platform usage.

  • Actor Start: $0.005 per GB of memory allocated to the run upon initialization.
  • Dataset Results: $0.005 per emitted item on the FREE plan tier (discounted to $0.00433 on BRONZE, $0.00367 on SILVER, and $0.003 on GOLD, PLATINUM, and DIAMOND tiers).

Platform usage for the run is billed separately at your Apify plan's rates.

Setting includeFullDetails: true requires the Actor to make an additional HTTP request per company record. While this does not increase the per-item event cost, the extra HTTP fetches increase execution duration and memory consumption, which increases the underlying platform usage for the run.

Workflow limits and pagination boundaries

A single run of this Actor supports harvesting up to 5,000 company records via the maxItems parameter. However, this approach does not monitor real-time WebSocket state changes or live feed updates; it executes a snapshot crawl of the directory based on the parameters passed at runtime.


B Corp Directory Scraper is what these steps drive. The README covers the inputs this article skipped, including the ones that change how much a run costs.

Top comments (0)