eCommerce Link Builder
Use cases
Searches Google for "[Brand Name] Stockists" queries via the DataForSEO SERP API (Google organic, live advanced endpoint, top 10 results) to find manufacturer stockist pages.
Filters for position 1 results only, removes homepages (URL depth filtering), and deduplicates URLs.
Country and language are set by editing two constants (location code and language code, with UK and US codes included), and an estimated API cost is printed before the run.
Platform
Python script (requires Python 3.x)
Input
Brand names list
DataForSEO login and password
Output
CSV with stockist page opportunities
Features
- DataForSEO SERP API integration (Google organic, live advanced endpoint)
- Position 1 filtering (top result only)
- URL depth calculation to exclude homepages
- Any country and language via location and language code constants
- Configurable 'Stockists' query suffix
- Built-in rate limiting (1s delay between requests)
- Estimated API cost printed before the run
- Deduplicates results by URL
How to use
- 1 Create brands.txt with brand names you stock (one per line)
- 2 Set DataForSEO credentials via environment variables or the script constants
- 3 Set the location and language code constants if needed
- 4 Run the script to query '[Brand] Stockists' for each brand
- 5 Review filtered results (position 1, non-homepage URLs, deduplicated)
- 6 Results save automatically to brand_links_output.csv (query, URL, title, description)
Frequently asked questions
- Why do some of my brands return no results at all?
- Two filters remove results silently. Only the position 1 organic result for each '[Brand] Stockists' search is kept, so a stockist page ranking second yields nothing for that brand. Any URL with a depth of exactly 2 slashes (a bare homepage such as https://brand.com) is also removed, so if the top result is the brand's homepage the brand disappears from the output. Duplicated URLs across brands are then deduplicated, keeping the first.
- What does it cost to run?
- The script uses the paid DataForSEO SERP API and makes exactly one search request per brand in brands.txt, with a 1 second sleep between requests. Usage therefore scales linearly with the number of brands, and the script prints an estimated cost (at $0.002 per query) before it starts.
- How do I set it up and change the target country?
- Credentials come from the DATAFORSEO_LOGIN and DATAFORSEO_PASSWORD environment variables, or the matching constants at the top of the script (they ship as placeholders). Put one brand per line in a brands.txt file in the same folder. Country and language are set via the LOCATION_CODE and LANGUAGE_CODE constants; UK (2826) and US (2840) codes are included, and any DataForSEO location code works. The 'Stockists' suffix is also a constant (STOCKISTS_SUFFIX) so you can switch to 'Dealers', 'Where to buy' and so on.
- Why is a non-stockist page in my results?
- The script trusts Google's top result for the query and applies no content check, so any page that happens to rank 1 for '[Brand] Stockists' gets through as long as it is not a homepage. Results with a missing URL, title or description are dropped, but relevance still needs a manual review pass of the output CSV (brand_links_output.csv, UTF-8 with BOM).
Want me to run this for you?
I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.
Related Tools
Create interactive Plotly treemaps of link distribution from crawl or GSC data.
Find Wikipedia pages that need citations in your niche. Built with Streamlit.
Find link opportunities by intersecting competitor backlink profiles.
Find internal linking opportunities by matching keywords to page content.
Extract internal links from pages, check status codes, and analyse anchor text.
Preview how your page will appear in Google search results.
Need something built for your business?
This tool started as bespoke client work. I build custom scripts, data pipelines, and full apps for SEO and product data problems that off-the-shelf tools don't solve.
Book a Call