{ "answer": "Apple's Q4 2024 revenue was $119.58B while Microsoft's Q4 2024 revenue was $62.02B. The difference is $57.56B, with Apple generating approximately 93% more revenue than Microsoft in this quarter.", "citations": [ { "document_id": "doc_apple_10k", "document_name": "Apple 10-K 2024", "page": 24, "content": "Total net revenue: $119,575 million", "visual_type": "table", "confidence": 0.97 }, { "document_id": "doc_msft_10k", "document_name": "Microsoft 10-K 2024", "page": 31, "content": "Revenue: $62,020 million", "visual_type": "chart", "confidence": 0.95 } ], "query_time_ms": 342}
Endpoints
Query
Search and reason over your visual knowledge base
The Query endpoint provides visual search and reasoning capabilities across your indexed documents. Get answers with audit-ready citations pointing to exact sources.
curl -X POST https://api.polyvia.ai/query \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "What is the difference between Apple and Microsoft Q4 2024 revenue?", "include_citations": true, "mode": "reasoning" }'
Copy
{ "answer": "Apple's Q4 2024 revenue was $119.58B while Microsoft's Q4 2024 revenue was $62.02B. The difference is $57.56B, with Apple generating approximately 93% more revenue than Microsoft in this quarter.", "citations": [ { "document_id": "doc_apple_10k", "document_name": "Apple 10-K 2024", "page": 24, "content": "Total net revenue: $119,575 million", "visual_type": "table", "confidence": 0.97 }, { "document_id": "doc_msft_10k", "document_name": "Microsoft 10-K 2024", "page": 31, "content": "Revenue: $62,020 million", "visual_type": "chart", "confidence": 0.95 } ], "query_time_ms": 342}
Polyvia automatically reasons across multiple documents to answer complex queries. For example:Query: “Compare the revenue growth of Apple, Microsoft, and Google over the last 3 years”Polyvia will:
Search for revenue data across all relevant documents
Extract facts from charts, tables, and text
Synthesize a comparative answer with citations from each source
For best results with cross-document queries, ensure your documents are properly tagged with metadata like company names, time periods, and document types.