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

# Retrieve carrier transit times

> Retrieves the average transit time of a parcel per carrier.
You can filter the results by origin and destination country, as well as by start and end dates.



## OpenAPI

````yaml /.openapi/v2/analytics/openapi.yaml get /insights/carriers/transit-times
openapi: 3.1.0
info:
  title: Analytics
  version: 2.0.0
  description: >-
    The Analytics API lets you query for insights about parcels, products and
    transit times.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
servers:
  - url: https://panel.sendcloud.sc/api/v2
    description: Sendcloud Production
security: []
tags:
  - name: Parcels
    description: Get insights about parcels
  - name: Products
    description: Get insights about products
  - name: Transit times
    description: Get insights about average transit times per carriers and shipping methods
  - name: User Carriers and Shipping Methods
    description: Get list of carriers and shipping methods a user ever used
paths:
  /insights/carriers/transit-times:
    get:
      tags:
        - Transit times
      summary: Retrieve carrier transit times
      description: >-
        Retrieves the average transit time of a parcel per carrier.

        You can filter the results by origin and destination country, as well as
        by start and end dates.
      operationId: sc-public-v2-analytics-get-carrier_transit_times
      parameters:
        - schema:
            type: array
            items:
              type: string
              example: postnl
          in: query
          name: carrier_code
          description: selection of carriers
          required: true
        - schema:
            type: string
            example: DE
          in: query
          name: from_country
          description: origin country
        - schema:
            type: string
            example: NL
          in: query
          name: to_country
          description: destination country
        - schema:
            type: string
            format: date
            example: '2020-12-31'
          in: query
          name: start_date
          description: first delivery start date
        - schema:
            type: string
            format: date
            example: '2022-12-31'
          in: query
          name: end_date
          description: first delivery end date
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarrierTransitTime'
              examples:
                TransitTimes:
                  summary: Retrieve Carriers transit times
                  value:
                    transit_times:
                      - user_id: '1234'
                        carrier_code: postnl
                        from_country: NL
                        to_country: DE
                        start_date: '2022-12-31'
                        end_date: '2023-11-17'
                        total_parcels: 2406
                        transit_time: 82
                      - user_id: '1234'
                        carrier_code: dhl
                        from_country: DE
                        to_country: AT
                        start_date: '2021-12-31'
                        end_date: '2022-12-31'
                        total_parcels: 75422
                        transit_time: 51
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                ValidationError:
                  summary: Validation error
                  value:
                    detail:
                      - loc:
                          - query
                          - carrier-code
                        msg: field required
                        type: value_error.missing
      security:
        - HTTPBasicAuth: []
components:
  schemas:
    CarrierTransitTime:
      type: object
      title: User Carrier Transit Times Object
      properties:
        transit_times:
          type: array
          description: array of transit time objects
          items:
            type: object
            properties:
              user_id:
                type: string
                example: '12345'
              carrier_code:
                type: string
                example: postnl
              to_country:
                type: string
                example: DE
              from_country:
                type: string
                example: NL
              start_date:
                type: string
                format: date
              end_date:
                type: string
                format: date
              total_parcels:
                type: integer
                description: total number of parcels matching the filters
                minimum: 0
              transit_time:
                type: number
                description: average transit times for the matching parcels
                minimum: 0
            required:
              - user_id
              - carrier_code
              - total_parcels
              - transit_time
      required:
        - transit_times
    Errors:
      title: Errors Object
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ErrorItem'
    ErrorItem:
      title: Error Item Object
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            type: string
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic

````