Skip to Content

GET

/api/fetchIndustries


Try Me!

GET /api/fetchIndustries

Query Parameters

Response Schema

FieldTypeDescription
companystringName of the company

Summary

Returns a list of all industries currently supported by the platform.

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 Industries API retrieves industry records from the database and returns them as a JSON array.

Key characteristics of this endpoint:

  • Publicly accessible (no authentication required)
  • No query parameters or 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 supported industries across the platform.


Endpoint

GET /api/fetchIndustries

Request

This endpoint does not accept any parameters

Headers

This endpoint does not accept any parameters

HeaderRequiredDescription
AcceptOptionalDefaults to application/json

Response Schema

Success - 200 OK

Industry[]
Industry Object
FieldTypeDescription
industrystringName of the industry
Example Response
[ { "industry": "Energy" }, { "industry": "Healthcare" }, { "industry": "Technology" } ]
Empty Response

If no industries 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
  1. MongoDB Connection Issues
  2. 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
  1. Unhandled runtime exception
  2. Application-level failure outside database operations.

Implementation Notes

  1. Uses a MongoDB find() query with projection to exclude _id
  2. Materializes the cursor before returning the response
  3. Logs both database-specific and unexpected errors for observability
  4. Treats empty datasets as a valid state, not an error condition
Last updated on