> ## 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 shipping method transit times

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



## OpenAPI

````yaml /.openapi/v2/analytics/openapi.yaml get /insights/shipping-methods/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/shipping-methods/transit-times:
    get:
      tags:
        - Transit times
      summary: Retrieve shipping method transit times
      description: >-
        Retrieves the average transit time of a parcel per shipping method and
        carrier.

        You can filter the results by origin and destination country, as well as
        start and end dates.
      operationId: sc-public-v2-analytics-get-shipping_method_transit_times
      parameters:
        - schema:
            type: array
            items:
              type: string
              example: postnl:standard/kg=0-23
          in: query
          name: shipping_method_code
          description: selection of shipping methods
          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: '2021-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/ShippingMethodTransitTime'
              examples:
                TransitTimes:
                  summary: Retrieve Shipping method transit times
                  value:
                    transit_times:
                      - user_id: '1234'
                        carrier_code: postnl
                        shipping_method_code: postnl:standard/kg=0-23
                        from_country: NL
                        to_country: DE
                        start_date: '2022-12-31'
                        end_date: '2023-12-31'
                        total_parcels: 240
                        transit_time: 92
                      - user_id: '1234'
                        carrier_code: dhl
                        shipping_method_code: dhl:complete/standard
                        from_country: DE
                        to_country: AT
                        start_date: '2022-12-31'
                        end_date: '2023-12-31'
                        total_parcels: 752
                        transit_time: 53
        '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
                      - loc:
                          - query
                          - shipping-method-code
                        msg: field required
                        type: value_error.missing
      security:
        - HTTPBasicAuth: []
components:
  schemas:
    ShippingMethodTransitTime:
      type: object
      title: User Shipping Method 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
              shipping_method_code:
                type: string
                example: express-postnl-1-3kg
              from_country:
                type: string
                example: ES
              to_country:
                type: string
                example: AT
              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
              - shipping_method_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

````