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

# URL Redirection Checker



## OpenAPI

````yaml POST /redirectcheck
openapi: 3.1.0
info:
  title: Geekflare
  description: Official OpenAPI specification for all Geekflare endpoints.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.geekflare.com
security:
  - x-api-key: []
paths:
  /redirectcheck:
    post:
      tags:
        - api-tool
      summary: Check the redirection chain of a given URL
      operationId: redirectCheck
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedirectCheckDto'
      responses:
        '200':
          description: Successfully retrieved redirect chain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedirectCheckResponseDto'
        '400':
          description: Invalid URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 400
                message: INVALID_URL
                details: The URL must be a valid HTTP or HTTPS URL.
        '429':
          description: Too many redirects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 429
                message: TOO_MANY_REDIRECTS
                details: >-
                  Exceeded the maximum number of redirects while resolving the
                  target URL.
        '500':
          description: Redirect check failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 500
                message: REDIRECT_CHECK_FAILED
                details: Unable to determine the redirect chain for the target URL.
components:
  schemas:
    RedirectCheckDto:
      type: object
      properties:
        url:
          type: string
          description: Target URL
          example: https://example.com
        proxyCountry:
          type: string
          description: Proxy country code to route the request
          example: us
      required:
        - url
    RedirectCheckResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1783943217189
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        meta:
          description: Metadata about the redirection check.
          example:
            url: example.com
            proxyCountry: United States
            test:
              id: 667zexrk0aaiabz2rx95b2cxm0khc2s0
          allOf:
            - $ref: '#/components/schemas/RedirectCheckMetaDto'
        data:
          description: List of redirection hops with status and headers.
          type: array
          items:
            $ref: '#/components/schemas/RedirectHopDto'
      required:
        - timestamp
        - apiStatus
        - apiCode
        - meta
        - data
    BaseErrorResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1778737930991
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        message:
          type: string
          description: Error message
          example: Invalid URL provided
        details:
          type: string
          description: Detailed error information
          example: The URL must be a valid HTTP or HTTPS URL
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
    RedirectCheckMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The original URL checked
          example: example.com
        proxyCountry:
          type: object
          description: Proxy country used (if any)
          example: US
        test:
          description: Test details object
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - proxyCountry
        - test
    RedirectHopDto:
      type: object
      properties:
        url:
          type: string
          description: The URL at this hop
          example: http://example.com/
        status:
          type: number
          description: HTTP status code at this hop
          example: 301
        headers:
          description: Response headers
          example:
            - name: location
              value: https://example.com/
            - name: date
              value: Mon, 29 Aug 2022 07:17:31 GMT
          type: array
          items:
            type: string
      required:
        - url
        - status
        - headers
    TestMetaDto:
      type: object
      properties:
        id:
          type: string
          description: Unique test identifier
          example: mxqx9v9y0742lap6altwdteqd28t23nq
      required:
        - id
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required for all endpoints

````