Canadian Financial Statements Analyst

Canadian Financial Statements Analyst · GPT 작업

Financial Performance Data API

A simple API for accessing financial data, with functionality for reading/writing CSV files, database interaction, data pagination, and health checks.

  • GET /healthHealth check for database connectivity
  • GET /revenue/{revenue_range}/Listing files for a specific revenue range
  • GET /revenue/{revenue_range}/{filename}/dataFetch paginated financial data for a specific revenue range and file
  • GET /data-dictionary-textGet the data dictionary text
  • POST /import-csvImport CSV data into the database
  • GET /knowledge_base/cleaned_naics_descriptors_2022.csvDownload NAICS descriptors data
원본 API 스키마
openapi: 3.0.0
info:
  title: Financial Performance Data API
  version: "1.0"
  description: A simple API for accessing financial data, with functionality for reading/writing CSV files, database interaction, data pagination, and health checks.

servers:
  - url: https://c674f69d-fb9b-483e-8245-d55f52f28108-00-380gpq9qydf2v.picard.replit.dev/
    description: Production server

paths:
 

  /health:
    get:
      summary: Health check for database connectivity
      operationId: getHealthStatus
      responses:
        '200':
          description: Health status of the database
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum: [Healthy, Unhealthy]
                  timestamp:
                    type: string
                    format: date-time
        '500':
          description: Health check failed

  /revenue/{revenue_range}/:
    get:
      summary: Listing files for a specific revenue range
      operationId: listRevenueFiles
      parameters:
        - name: revenue_range
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of files in the specified revenue range
          content:
            application/json:
              schema:
                type: object
                properties:
                  files:
                    type: array
                    items:
                      type: string
        '404':
          description: Data folder not found for the specified revenue range
        '500':
          description: Error listing files

  /revenue/{revenue_range}/{filename}/data:
    get:
      summary: Fetch paginated financial data for a specific revenue range and file
      operationId: getRevenueData
      parameters:
        - name: revenue_range
          in: path
          required: true
          schema:
            type: string
        - name: filename
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 100
      responses:
        '200':
          description: Paginated data for the specified revenue range and file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedModel'
        '404':
          description: File or revenue range not found
        '500':
          description: Error in fetching data

  
  /data-dictionary-text:
    get:
      summary: Get the data dictionary text
      operationId: getDataDictionary
      responses:
        '200':
          description: Data dictionary text
          content:
            application/json:
              schema:
                type: object
                properties:
                  data_dictionary:
                    type: string
        '404':
          description: Data dictionary not found
        '500':
          description: Error in fetching data dictionary

  /import-csv:
    post:
      summary: Import CSV data into the database
      operationId: importCSV
      responses:
        '200':
          description: CSV files imported successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '500':
          description: Error during CSV import

  /knowledge_base/cleaned_naics_descriptors_2022.csv:
    get:
      summary: Download NAICS descriptors data
      operationId: downloadNaicsDescriptors
      responses:
        '200':
          description: NAICS descriptors data file
          content:
            text/csv:
              schema:
                type: string
                format: binary
        '404':
          description: NAICS descriptors data not available
        '500':
          description: Error serving NAICS descriptors data


components:
  schemas:
    PaginatedModel:
      type: object
      properties:
        total_records:
          type: integer
        page:
          type: integer
        page_size:
          type: integer
        data:
          type: array
          items:
            type: object
            additionalProperties: true