import requests
api_key = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {api_key}"}
# Upload multiple documents
documents = [
"apple_10k_2024.pdf",
"apple_10k_2023.pdf",
"microsoft_10k_2024.pdf",
"microsoft_10k_2023.pdf",
"google_10k_2024.pdf",
"amazon_10k_2024.pdf"
]
for doc in documents:
with open(doc, "rb") as f:
response = requests.post(
"https://api.polyvia.ai/ingest",
headers=headers,
files={"file": f},
data={"name": doc}
)
print(f"Ingested {doc}: {response.json()['document_id']}")