Skip to main content
This tutorial shows you how to fetch a web page and get it back as Markdown, plain text and HTML using the Bright Data Fetch API.

Prerequisites

1

Get your API key

Go to the user settings page in your Bright Data account and create an API key, or use one you already have.If you don’t have an account yet, sign up at brightdata.com. New accounts get 5,000 free credits every month, no credit card required. See the free tier.
Your API key is shown only once when created. Copy and store it securely.
2

Send a request

We’ll fetch https://example.com with the Collect by URL endpoint, using a synchronous request. Replace YOUR_API_KEY with your API key:
You should see a 200 status code and a JSON array with one record. A 202 means the fetch needs longer than 1 minute; see the note below. Processing time varies with target-site conditions.
A synchronous request waits up to 1 minute. If the Bright Data Fetch API needs longer, the response is HTTP 202 with a snapshot_id instead of page data, and collection continues asynchronously. Fetch the result with the async workflow or have it pushed to you with webhook delivery.
3

Review the response

The Bright Data Fetch API returns a JSON array with one record per URL:
The page_html value is trimmed here. Use markdown for an LLM prompt, html2text for plain text and page_html when you need the full source. See the full response schema.
You’ve fetched your first web page using the Bright Data Fetch API.

Common questions

Can I fetch multiple URLs in one request?

Yes. Add more objects to the input array. The URLs can be on different domains. Bright Data recommends 20 URLs or fewer per synchronous request, a best practice rather than a hard limit. For larger batches, use the async /trigger endpoint.

Getting a 401 or 403 error?

Verify your API key is correct and hasn’t expired. Create a new API key in Account settings. See the authentication guide for details.

Request is timing out?

Synchronous requests have a 1-minute timeout. If the request exceeds this limit, the API returns HTTP 202 with a snapshot_id and finishes the job asynchronously. Use the async workflow for large batches.

Why is a field missing from the record?

A field with no value can be left out. For example, ld_json is missing when the page has no JSON-LD metadata. Check that the URL is public and returns a page in a browser.

Next steps

Endpoints

Country targeting, field selection and batch requests.

Async batch requests

Fetch hundreds of URLs in a single batch job.

Set up webhooks

Receive results automatically when fetching completes.