import requests
import time
import json
# Configuration
API_URL = 'https://api.olostep.com/v1'
API_KEY = '<your_olostep_api_key>'
HEADERS = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {API_KEY}'
}
# Start time for latency tracking
start_time = time.time()
# Define the payload with URL patterns to include
payload = {
"url": "https://stripe.com",
"include_urls": ["/blog", "/blog/**"] # Match /blog and all paths under /blog
}
# Make the request
response = requests.post(f'{API_URL}/maps', headers=HEADERS, json=payload)
# Calculate latency
latency = round((time.time() - start_time) * 1000, 2)
print(f"Request completed in {latency}ms")
# Process the results
data = response.json()
print(f"Found {data['urls_count']} blog URLs on Stripe's website")
# Print the first 10 URLs as a sample
print("\nSample blog URLs:")
for url in data['urls'][:10]:
print(f"- {url}")
# Save blog URLs to a file for further processing
with open('stripe_blog_urls.json', 'w') as f:
json.dump(data, f, indent=2)
print(f"\nAll blog URLs saved to stripe_blog_urls.json")