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

# Within Operation

> Query Lightnings Within Given Point and Radius. Maximum backward interval is 30 days, maximum radius is 50 km.



## OpenAPI

````yaml /open-api/en/lightnings_version-1.json post /v1/lightnings/within
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.iklim.co
    description: Production server
  - url: https://api-test.iklim.co
    description: Test server
security: []
tags:
  - name: Lightning Service
    description: Manages Lightning Related Services
paths:
  /v1/lightnings/within:
    post:
      tags:
        - Lightning Service
      summary: Within Operation
      description: >-
        Query Lightnings Within Given Point and Radius. Maximum backward
        interval is 30 days, maximum radius is 50 km.
      operationId: getWithin
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LightningsWithinRequest'
        required: true
      responses:
        '200':
          description: >-
            Lightnings Found Within Given Point and Radius. This Response is
            Paged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LightningsResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '402':
          description: Paid Subscription Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Payment Required:
                  summary: Example response
                  description: Payment Required
                  value:
                    timestamp: '2025-06-25T11:15:41.429518242'
                    status: 402
                    error: Payment Required
                    message: You Need To Renew Your Subscription or Purchase New One
                    path: /v1/lightnings/within
        '403':
          description: Forbidden/Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                No Subscription Found For This Service Endpoint:
                  summary: Missing Subscription
                  description: No Subscription Found For This Service Endpoint
                  value:
                    timestamp: '2025-06-25T11:21:50.510755746'
                    status: 403
                    error: Forbidden
                    message: No Subscription Found For This Service Endpoint
                    path: /v1/lightnings/within
                This Location Is Not In Allowed Geographic Boundaries:
                  summary: Out of Allowed Geographic Boundaries
                  description: This Location Is Not In Allowed Geographic Boundaries
                  value:
                    timestamp: '2025-06-25T15:59:19.452326857'
                    status: 403
                    error: Forbidden
                    message: >-
                      The Location You Are Querying [dd.ddddd, dd.ddddd] Is Not
                      Within The Geographic Boundaries Allowed In Your
                      Subscription [Country, Region]
                    path: /v1/lightnings/within
        '429':
          description: Subscription Limits For This Service is Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Too Many Requests:
                  summary: Example response
                  description: Too Many Requests
                  value:
                    timestamp: '2025-06-25T11:02:12.653874655'
                    status: 429
                    error: Too Many Requests
                    message: Your Subscription Limits For This Service is Exceeded
                    path: /v1/lightnings/within
        '500':
          description: Internal Server Error During Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Internal Server Error Example:
                  summary: Example response
                  description: Internal Server Error Example
                  value:
                    timestamp: '2025-04-14T16:58:10.414972912'
                    status: 500
                    error: Internal Server Error
                    message: An Error Occurred During Invocation
                    path: /endpoint/uri/here
components:
  schemas:
    LightningsWithinRequest:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Latitude in decimal degrees
          example: 39.869847
          maximum: 90
          minimum: -90
        longitude:
          type: number
          format: double
          description: Longitude in decimal degrees
          example: 32.745468
          maximum: 180
          minimum: -180
        radius:
          type: number
          format: double
          description: Radius in meters
          example: 1000
          maximum: 50000
          minimum: 0
        backwardInterval:
          type: integer
          format: int64
          description: Backward Interval in seconds
          example: 600
          maximum: 2592000
          minimum: 60
        endTimeEpoch:
          type: integer
          format: int64
          description: End time in Epoch milliseconds
          example: 1746454091000
          minimum: 0
        pageNumber:
          type: integer
          format: int32
          description: Page number
          example: 0
          minimum: 0
        pageSize:
          type: integer
          format: int32
          description: Page size
          example: 10
          maximum: 100
      required:
        - backwardInterval
        - endTimeEpoch
        - latitude
        - longitude
        - pageNumber
        - pageSize
        - radius
    LightningsResponse:
      type: object
      properties:
        lightnings:
          type: array
          description: Lightnings data
          example: []
          items:
            $ref: '#/components/schemas/Lightning'
        totalRecords:
          type: integer
          format: int32
          description: Total records
          example: 1000
        pageNumber:
          type: integer
          format: int32
          description: Page number
          example: 0
        pageSize:
          type: integer
          format: int32
          description: Page size
          example: 10
      required:
        - lightnings
        - pageNumber
        - pageSize
        - totalRecords
    StandardErrorResponse:
      type: object
      description: Standard API error response structure
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the error occurred
          example: YYYY-mm-DDTHH:MM:SS.nnnnnnnnn
        status:
          type: integer
          format: int32
          description: HTTP status code
          example: XXX
        error:
          type: string
          description: Error name or type
          example: Error Name
          minLength: 1
        message:
          type: string
          description: Main error message
          example: Error Message
          minLength: 1
        messages:
          type: array
          description: Additional detailed error messages
          items:
            type: string
        path:
          type: string
          description: Request path that caused the error
          example: /endpoint/uri/here
          minLength: 1
      required:
        - error
        - message
        - path
        - status
        - timestamp
    Lightning:
      type: object
      properties:
        captured:
          type: string
          format: date-time
          description: >-
            Time in Universal Time Coordinated (UTC). Note that the 'time' for a
            flash is recorded as the time of the major pulse of the flash
          example: '2025-04-14T16:58:22.22308754'
        type:
          type: integer
          format: int32
          description: >-
            By definition, a pulse is classified as 'FLASH' (cloud to ground)
            when it contains a return stroke. Any pulse that does not contain a
            return stroke is classified as 'PULSE' (in-cloud). However, it
            should be stressed that the PULSE classification may include other
            types of FLASH lightning, including narrow bi-polar events and
            K-changes
          enum:
            - 0
            - 1
            - 9
            - 40
          example: 0
        typeName:
          type: string
          description: >-
            By definition, a pulse is classified as 'FLASH' (cloud to ground)
            when it contains a return stroke. Any pulse that does not contain a
            return stroke is classified as 'PULSE' (in-cloud). However, it
            should be stressed that the PULSE classification may include other
            types of FLASH lightning, including narrow bi-polar events and
            K-changes
          example: FLASH
        latitude:
          type: number
          format: double
          description: Latitude in decimal degrees
          example: 39.869847
        longitude:
          type: number
          format: double
          description: Longitude in decimal degrees
          example: 32.745468
        peakCurrent:
          type: number
          format: double
          description: >-
            Peak Current for Cloud-to-Ground or peak radiated field normalized
            to 30 km for In-Cloud lightning, both in amperes. Please note that
            the amplitude of a given flash is defined as the amplitude of the
            major pulse in the flash. For any global strikes that do not contain
            peak current data, the value will be zero
          example: -3803
        inCloudHeight:
          type: number
          format: double
          description: >-
            This parameter estimates the height of the PULSE lightning in
            meters. This value can be as high as 20,000 meters and it should be
            noted that it will be most accurate in locations with a high sensor
            density
          example: 1000
        numSensors:
          type: integer
          format: int32
          description: The number of sensors used in locating a lightning flash/pulse
          example: 10
        pulseErrorEllipse:
          $ref: '#/components/schemas/PulseErrorEllipse'
          description: >-
            Applies to pulses only. The true location of the lightning having a
            chance of being inside the ellipse. The error ellipse is constructed
            using the length of the major and minor axis in meters, and bearing
        multiplicity:
          $ref: '#/components/schemas/Multiplicity'
          description: >-
            A flash can consist of many pulses. Therefore, this number
            represents the number of pulses in each flash
        flashMeta:
          $ref: '#/components/schemas/FlashMeta'
          description: >-
            Applies to flashes only. Gives information about the duration of the
            flash strike and the area the flash is located
        distance:
          type: number
          format: double
          description: Distance in meters from the given center coordinates
    PulseErrorEllipse:
      type: object
      properties:
        eeMajor:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.pulse-error-ellipse.major
        eeMinor:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.pulse-error-ellipse.minor
        eeBearing:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.pulse-error-ellipse.bearing
    Multiplicity:
      type: object
      properties:
        inCloud:
          type: integer
          format: int32
          description: >-
            swagger.schema.lightning.within-response.lightning.multiplicity.in-cloud
        cloudToGround:
          type: integer
          format: int32
          description: >-
            swagger.schema.lightning.within-response.lightning.multiplicity.cloud-to-ground
    FlashMeta:
      type: object
      properties:
        startTime:
          type: string
          format: date-time
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.start-time
        duration:
          type: integer
          format: int64
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.duration
        ulLatitude:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.upper-left-lat
        ulLongitude:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.upper-left-lng
        lrLatitude:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.lower-right-lat
        lrLongitude:
          type: number
          format: double
          description: >-
            swagger.schema.lightning.within-response.lightning.flash-meta.lower-right-lng

````