Fetch Reports
GET
/api/proof/fetchData
Try Me!
Query Parameters
Response Schema
| Field | Type | Description |
|---|---|---|
| file_name | string | Name of the file |
| file_type | string | Type of the file, in lowercase |
| file_size | float | File size in megabytes, rounded to two decimal places |
Summary
Returns a list of all reports that have currently been ingested by the system for the given company.
This endpoint is designed for read-only access and is commonly used by client applications to populate industry selectors such as dropdowns, filters, and search facets.
Description
The Fetch Report Files API retrieves report records from the database and returns them as a JSON array.
Key characteristics of this endpoint:
- Publicly accessible (no authentication required)
- One query parameter, one optional header, and no request body
- Database identifiers (
_id) are excluded from responses - Empty results are treated as a valid, non-error response
- Clear separation between database errors and unexpected server failures
This endpoint serves as the authoritative source of ingested reports across the platform.
Endpoint
GET /api/proof/fetchDataRequest
This endpoint accepts a singular parameter: company_slug.
Parameters
| Parameters | Required | Type | Description |
|---|---|---|---|
company_slug | mandatory | string | The slug of the company you wish to search for |
Headers
This endpoint accepts a singular optional header.
| Header | Required | Description |
|---|---|---|
Accept | optional | Defaults to application/json |
Response Schema
Success - 200 OK
Report[]Report Object
| Field | Required | Type | Description |
|---|---|---|---|
file_size | mandatory | float | Floating-point number representing the size of the file, in megabytes |
file_name | mandatory | string | Name of the report |
file_type | mandatory | string | File type, in lowercase |
Example Response
[
{
"file_size": 5.22,
"file_name": "2025",
"file_type": "pdf"
},
{
"file_size": 16.02,
"file_name": "2020",
"file_type": "pdf"
}
]Empty Response
If no reports are available, an empty array is returned:
[]Error Codes & Response Types
503 Service Unavailable
Returned when the database is temporarily unavailable, or a query fails due to a database issue
Response Body
{
"detail" : "Database temporarily unavailable"
}Typical Causes
- MongoDB Connection Issues
- Database timeout or query failure for a non-general reason
500 Internal Server Error
Returned when an unexpected server-side error occurs.
Response Body
{
"detail" : "Internal server error"
}Typical Causes
- Unhandled runtime exception
- Application-level failure outside database operations.
Implementation Notes
- Uses a MongoDB find() query with projection to exclude _id
- Materializes the cursor before returning the response
- Logs both database-specific and unexpected errors for observability
- Treats empty datasets as a valid state, not an error condition