Strategies
A strategy is a reusable extraction plan that tells Meter how to extract data from a webpage. Think of it like a recipe: you create it once by describing what you want, and Meter’s AI figures out the exact selectors and extraction logic.What is a strategy?
A strategy contains:- Extraction method: Either CSS Path (for traditional HTML) or API Path (for JavaScript-heavy sites)
- Field definitions mapping selectors or API responses to your data fields
- Extraction metadata like item containers, scopes, or API endpoints
How strategies are generated
Meter uses AI to analyze your target webpage and generate precise extraction strategies:- You provide: A URL and plain-English description of what to extract
- Meter analyzes: The page structure, HTML patterns, and content layout
- AI generates: CSS selectors and extraction rules optimized for that page
- You get: A reusable strategy plus preview data showing what was extracted
Example
Extraction methods
Meter automatically selects the best extraction method for each site. You describe what you want, and Meter figures out how to get it.CSS Path extraction
For traditional HTML pages, Meter generates CSS selectors that target the content you need. Best for:- Static HTML sites
- Server-rendered pages
- Sites with stable DOM structure
- Blogs, news sites, and content pages
API Path extraction
For JavaScript-heavy sites, Meter automatically discovers the underlying APIs that power the page and extracts data directly from them.
Best for:
- Single-page applications (React, Vue, Angular)
- Financial data sites
- Dynamic dashboards
- Sites with client-side rendering
Automatic token handling
JavaScript-heavy sites often require authentication tokens to access their APIs. Meter handles this automatically—you don’t need to worry about the details.CSRF Tokens
CSRF Tokens
Many sites protect their APIs with CSRF tokens. Meter detects and includes these tokens automatically, so your extractions work without manual configuration.
Session Cookies
Session Cookies
Custom Headers
Custom Headers
API keys, authorization headers, and other required headers are automatically included in requests.
Multi-API Chains
Multi-API Chains
Some sites require multiple API calls in sequence. Meter handles these dependencies and chains requests in the correct order.
Real-world example: Financial data
Consider extracting stock quotes from a financial data site. When you visit the page, you see prices updating in real-time—but the HTML source shows almost nothing. The data is loaded via JavaScript from a hidden API. With traditional scraping, you would need to:- Reverse-engineer the API endpoints
- Figure out the authentication requirements
- Handle CSRF tokens and session management
- Parse the JSON response format
- Discovers the quote API endpoint
- Captures any required authentication tokens
- Extracts the structured data from API responses
- Returns clean, normalized data
Strategy lifecycle
- Generate: Create strategy with AI
- Preview: Check the
preview_datato verify extraction - Refine (optional): Provide feedback if something’s missing
- Use: Run jobs with the strategy
- Monitor: Check if results are still accurate over time
Refining strategies
If the initial extraction isn’t perfect, refine it with feedback:When to create new strategies
Create a new strategy when:Different Site Structure
Each website layout needs its own strategy
Different Data Fields
Different extraction requirements need different strategies
Major Site Redesign
If a site changes its HTML structure significantly
Different Page Types
Product pages vs. category pages need separate strategies
Reusing strategies
You can reuse the same strategy across:- Multiple URLs on the same site (e.g., different products)
- Pagination (if the structure is consistent)
- Similar pages (if they share HTML structure)
Strategy management
Listing strategies
Getting strategy details
Deleting strategies
Best practices
Use descriptive names
Use descriptive names
Give strategies clear names that describe their purpose:Good:
"HN Front Page - Titles and Scores"
Bad: "Strategy 1"This helps when managing multiple strategies.Test with refinement
Test with refinement
Always check
preview_data before creating jobs:Be specific in descriptions
Be specific in descriptions
Provide clear, specific extraction instructions:Good: “Extract product name, price with currency, main image URL, and stock availability from the product grid”Bad: “Get products”Specific descriptions lead to better strategies on the first try.
Monitor strategy health
Monitor strategy health
Strategies can break if sites change their HTML:
Troubleshooting
Strategy generation fails
Strategy generation fails
Possible causes:
- URL is not accessible
- Page requires authentication
- Description is too vague
- Verify the URL loads in a browser
- For auth-required pages, contact support
- Make your description more specific
Missing fields in preview
Missing fields in preview
Problem: Some expected fields aren’t in
preview_dataSolution: Use refinement:Strategy stops working
Strategy stops working
Problem: Jobs that worked before now fail or return incorrect dataCause: Website HTML structure changedSolutions:
- Generate a new strategy for the updated site
- Update your jobs to use the new strategy
- Delete the old strategy
API Path extraction returns empty data
API Path extraction returns empty data
Problem: Meter detected an API but returns no dataPossible causes:
- The API requires authentication that expired
- The site changed its API endpoints
- Rate limiting is blocking requests
- Generate a fresh strategy to capture new authentication tokens
- If the site has changed significantly, the strategy may need regeneration
- For rate-limited sites, reduce scrape frequency
Next steps
Create Jobs
Learn how to run scrapes using your strategies
Set Up Schedules
Automate scraping with recurring schedules
Python SDK Reference
Explore all strategy methods in the SDK
REST API Reference
View strategy endpoints in the REST API