import requests
import time
import json
# Konfiguration
API_URL = 'https://api.olostep.com/v1'
API_KEY = '<your_olostep_api_key>'
HEADERS = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {API_KEY}'
}
# Startzeit für Latenzverfolgung
start_time = time.time()
# Definiere die Nutzlast nur mit der Basis-URL
payload = {
"url": "https://stripe.com"
}
# Anfrage stellen
response = requests.post(f'{API_URL}/maps', headers=HEADERS, json=payload)
# Latenz berechnen
latency = round((time.time() - start_time) * 1000, 2)
print(f"Anfrage abgeschlossen in {latency}ms")
# Ergebnisse verarbeiten
data = response.json()
print(f"{data['urls_count']} URLs auf Stripes Website gefunden")
# Die ersten 10 URLs als Beispiel ausgeben
print("\nBeispiel-URLs:")
for url in data['urls'][:10]:
print(f"- {url}")
# Alle URLs zur weiteren Analyse in einer Datei speichern
with open('stripe_urls.json', 'w') as f:
json.dump(data, f, indent=2)
print(f"\nAlle URLs in stripe_urls.json gespeichert")