github / github/dotnet-codespaces

test_brightdata.py

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
245
Forks
321
PR merge metrics
No merged PRs in 30d

Description

import requests

API_KEY = "2aeaa6b4-7ba5-4d9a-8b80-e31caea98888"

ZONE = "web_unlocker1"

url = "https://api.brightdata.com/request"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}

payload = {
"zone": ZONE,
"url": "https://creative.apple.com",
"format": "raw",

# Optional: location targeting
"country": "us",
"city": "seattle",
# "asn": 12345, # if you know the ASN and it is enabled for your zone
}

try:
response = requests.post(url, json=payload, headers=headers, timeout=60)
response.raise_for_status()
result = response.json()

print("Status code from target site:", result.get("status_code"))
print("First 500 characters of page:")
print(result.get("body", "")[:500])

except Exception as e:
print("Error:", e)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing test_brightdata.py and the requests.post call to https://api.brightdata.com/request. The issue does not specify what should change or how completion should be verified, so confirm the intended behavior before editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.