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 just the base URL
payload = {
"url": "https://stripe.com"
}
# 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']} URLs on Stripe's website")
# Print the first 10 URLs as a sample
print("\nSample URLs:")
for url in data['urls'][:10]:
print(f"- {url}")
# Save all URLs to a file for further analysis
with open('stripe_urls.json', 'w') as f:
json.dump(data, f, indent=2)
print(f"\nAll URLs saved to stripe_urls.json")