How to pass headers
Use theheaders parameter available in SmartScraper, SearchScraper, and Markdownify:
Common use cases
Passing a session cookie
Export cookies from your browser (e.g., using a browser extension like EditThisCookie) and pass them as theCookie header:
Mimicking a real browser
Some sites block requests without a browser-like User-Agent:Bearer token authentication
For APIs or protected dashboards:Tips
- Headers are sent with the HTTP request to the target website, not to the ScrapeGraphAI API.
- Keep sensitive tokens out of your source code — load them from environment variables.
- If you are unsure which headers to pass, open the target URL in your browser, go to DevTools → Network, and inspect the request headers of the first successful page load.