> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spent amount of credits

> Retrieve a list of spent credits transactions based on the specified period and date range.


# Filtering

The `/api/auth/transactions/spent_credits/` endpoint allows you to get all spent credits grouped by endpoints in the period.

## Period

Must be on of: `day`, `week`, `month`, `quarter`, `year`.

## Date

* Date: yyyy-mm-dd\
  Example: 2025-01-01

* Date and Time: yyyy-mm-ddTHH:MM:SS.ssssss\
  Example: 2025-01-01T02:03:04.000000


## OpenAPI

````yaml get /api/auth/transactions/spent_credits/
openapi: 3.0.3
info:
  title: Generect API
  description: >-
    Welcome to the Generect API documentation. Here we will help you integrate
    and use our API.


    API base url: `api.generect.com`  

    Protocol: `HTTPS`


    # Authentication


    Firstly, add a `API Token` to the enviroment variables `auth_token` in
    `Settings` tab.


    # Rate limits


    Credits: You can request data depending on your data plan and credit
    balance. The default is 10000/month. The estimated number of credits to
    spend is based on the complexity of the query and the number of results. The
    amount spent can be increased by additional data flags in the queries.


    # Note


    _Ensure that you are add a "/" to the end of url._
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.generect.com
security:
  - apiKey: []
tags:
  - name: 1. Auth
    description: Login and get user info
  - name: 2. Transactions
    description: List of latest transactions in your account
  - name: 3. Leads
    description: Fetch information about leads by _link/name/ICP_.
  - name: 4. Companies
    description: Fetch information about companies by link/name/ICP.
paths:
  /api/auth/transactions/spent_credits/:
    get:
      summary: Fetch spent credits transactions
      description: >
        Retrieve a list of spent credits transactions based on the specified
        period and date range.
      parameters:
        - name: timezone
          in: query
          description: Timezone for date calculations
          required: true
          schema:
            type: string
        - name: period
          in: query
          description: The aggregation period for transactions
          required: true
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - quarter
              - year
        - name: start_date
          in: query
          description: The start date for the transaction filter (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: The end date for the transaction filter (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date
      responses:
        '200':
          description: A list of transactions for the specified period and date range
          content:
            application/json:
              schema:
                type: object
                properties:
                  spent_credits:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: number
                    example:
                      '2025-01-01T00:00:00':
                        /api/linkedin/leads/by_icp/: -4428
                        /api/linkedin/companies/by_icp/: -39
                        /api/linkedin/company/by_link/: -5
                        /api/linkedin/lead/by_link/: -3
                        /api/linkedin/email_finder/: -1
                        platform: -9
                      '2024-12-01T00:00:00':
                        /api/linkedin/leads/by_icp/: -383
                        /api/linkedin/company/by_link/: -17
                        /api/linkedin/companies/by_icp/: -156
                        /api/linkedin/lead/by_link/: -6
                        platform: -12
                      '2024-11-01T00:00:00':
                        /api/linkedin/companies/by_icp/: -101
                        /api/linkedin/leads/by_icp/: -1720
                        platform: -1469
                  total_spent_credits:
                    type: number
                    example: -8349
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Use 'Token <api-key>' as the value

````