A Python script that pulls running shoe data from Amazon, Walmart, and Nike.com and outputs a ranked, cross-retailer price comparison — all from a single prompt to your AI coding assistant.This tutorial shows the core power of Nimble: Web Search Agents work with any website, not just the ones in the gallery.The Nimble Agents skill handles the rest:
Finds pre-built agents for sites already in the gallery (Amazon, Walmart)
Generates a custom agent on the fly for Nike.com — a site with no pre-built agent
Writes the full analysis script using the agents it collected
Open a new session in Claude Code (or Cursor) and paste this prompt:
Claude Code
Cursor
Build a Python script that runs competitive analysis on running shoes acrossAmazon, Walmart, and Nike.com. Use Nimble for all data collection.For each retailer:- Search the Nimble agent gallery for an existing agent. Use it if one exists.- If no agent exists for that site, use the Nimble Agents skill to generate a custom one, then publish it for reuse.The script should collect product name, price, rating (if available), and URLfrom each source, then print a unified list sorted by price and save the fullresults to shoe_analysis.json.My Nimble API key is set as the NIMBLE_API_KEY environment variable.
Build a Python script that runs competitive analysis on running shoes acrossAmazon, Walmart, and Nike.com. Use Nimble for all data collection.For each retailer:- Search the Nimble agent gallery for an existing agent. Use it if one exists.- If no agent exists for that site, use the Nimble Agents skill to generate a custom one, then publish it for reuse.The script should collect product name, price, rating (if available), and URLfrom each source, then print a unified list sorted by price and save the fullresults to shoe_analysis.json.My Nimble API key is set as the NIMBLE_API_KEY environment variable.
Claude works through the task autonomously using the Nimble Agents skill. Here’s what happens under the hood:
1
Searches the gallery for Amazon
Claude calls nimble_agents_list with the query "amazon" and finds amazon_serp — a pre-built agent for Amazon search results. It inspects the schema and confirms keyword is the required input.
2
Searches the gallery for Walmart
Same flow for Walmart — finds walmart_search, confirms it takes a keyword param and returns product name, price, and rating.
3
Finds no agent for Nike — generates one
No public agent exists for nike.com. Claude calls nimble_agents_generate with a description of what’s needed, waits for the agent to be created, runs a test extraction, and publishes it as nike_running_shoes_plp.
4
Writes the script
With all three agents confirmed, Claude writes shoe_analysis.py using the Nimble Python SDK and the agent names it just collected.
The script Claude produces will look something like this:
import jsonimport osfrom nimble_python import Nimblenimble = Nimble(api_key=os.environ["NIMBLE_API_KEY"])KEYWORD = "running shoes"NIKE_URL = "https://www.nike.com/w/mens-running-shoes"def fetch_amazon(): result = nimble.agent.run( agent="amazon_serp", params={"keyword": KEYWORD} ) products = result.data.parsing.get("parsed", []) return [ { "source": "Amazon", "name": p.get("product_name"), "price": p.get("price"), "rating": p.get("average_rating"), "url": p.get("product_url"), } for p in products if p.get("price") ]def fetch_walmart(): result = nimble.agent.run( agent="walmart_search", params={"keyword": KEYWORD} ) products = result.data.parsing.get("parsed", []) return [ { "source": "Walmart", "name": p.get("product_name"), "price": p.get("price"), "rating": p.get("rating"), "url": p.get("product_url"), } for p in products if p.get("price") ]def fetch_nike(): result = nimble.agent.run( agent="nike_running_shoes_plp", params={"url": NIKE_URL} ) products = result.data.parsing.get("parsed", []) return [ { "source": "Nike", "name": p.get("product_name"), "price": p.get("price"), "colors": p.get("colors", []), "url": p.get("url"), } for p in products if p.get("price") ]def run_analysis(): print(f'Competitive analysis: "{KEYWORD}"\n') all_products = [] print("Fetching Amazon...") all_products.extend(fetch_amazon()) print("Fetching Walmart...") all_products.extend(fetch_walmart()) print("Fetching Nike...") all_products.extend(fetch_nike()) sorted_products = sorted(all_products, key=lambda x: x["price"]) print(f"\n{'=' * 55}") print(f" RESULTS — {len(all_products)} products across 3 retailers") print(f"{'=' * 55}\n") for i, p in enumerate(sorted_products[:15], 1): stars = f" ★{p['rating']}" if p.get("rating") else "" colors = f" ({len(p['colors'])} colors)" if p.get("colors") else "" print(f"{i:2}. [{p['source']:7}] ${p['price']:<8.2f} {p['name']}{stars}{colors}") with open("shoe_analysis.json", "w") as f: json.dump(all_products, f, indent=2) print(f"\nFull results saved to shoe_analysis.json")if __name__ == "__main__": run_analysis()
The exact agent names (e.g. nike_running_shoes_plp) are chosen by the skill at generation time. Claude will use whatever names were returned and write the script accordingly — you don’t need to track them manually.