servers:
- url: https://api.astaraconnect.com
  description: Production API server
- url: https://api-staging.astaraconnect.com
  description: Staging API server
paths:
  /v1/services/astaraplay/fuel-stations/in-route:
    post:
      summary: Retrieve fuel stations in a certain route.
      description: 'This endpoint returns all the fuel stations in a certain route,
        represented as a GeoJSON LineString, and for a given fuel type.

        It will return all the fuel stations in a 3 km buffer in the right side of
        the LineString representing the route.

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fuel_type:
                  description: A valid fuel type that will be used to filter the fuel
                    stations.
                  type: string
                  enum:
                  - biodiesel
                  - bioethanol
                  - cng
                  - lng
                  - lpg
                  - diesel_a
                  - diesel_a_premium
                  - diesel_b
                  - gasoline_93_e10
                  - gasoline_95_e10
                  - gasoline_95_e5
                  - gasoline_95_e5_premium
                  - gasoline_97_e10
                  - gasoline_98_e10
                  - gasoline_98_e5
                  - hydrogen
                  - gasoline_mix_2_stroke
                country_codes:
                  description: 'A list of valid country codes by which service stations
                    will be filtered. Country codes available: ESP - Spain, CHL -
                    Chile, PRT - Portugal.

                    '
                  type: array
                  items:
                    type: string
                    enum:
                    - ESP
                    - CHL
                    - PRT
                route:
                  description: A GeoJSON of a LineString that represents the route
                    where fuel stations will be searched, specifically on the right
                    side.
                  type: object
                  properties:
                    coordinates:
                      description: An array of coordinate pairs, written in the format
                        [longitude, latitude], localizing points along the route.
                      type: array
                      example:
                      - - -3.6926176000000077
                        - 40.41928309999999
                      - - -3.6923060999999735
                        - 40.41941329999999
                      - - -3.6920348999999963
                        - 40.41947839999999
                      items:
                        type: array
                        items:
                          type: number
                          example:
                          - -3.6926176000000077
                          - 40.41928309999999
                        maxItems: 2
                        minItems: 2
                    type:
                      type: string
                      enum:
                      - LineString
                  required:
                  - coordinates
              required:
              - fuel_type
              - route
            examples:
              Request with coordinates:
                value:
                  route:
                    coordinates:
                    - - -3.6926176000000077
                      - 40.41928309999999
                    - - -3.6923060999999735
                      - 40.41941329999999
                    - - -3.6920348999999963
                      - 40.41947839999999
                    - - -3.689373100000002
                      - 40.4198288
                    - - -3.6891816999999927
                      - 40.41982449999998
                    type: LineString
                  fuel_type: diesel_a
                  country_codes:
                  - ESP
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  fuel_types:
                    description: All the fuel_types available in at least one fuel
                      station in the bounding box
                    type: array
                    items:
                      type: string
                  fuel_stations:
                    description: Fuel stations offering the requested fuel type found
                      in the bounding box.
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        address:
                          type: string
                        brand:
                          type: string
                        country_code:
                          type: string
                        locality:
                          type: string
                        municipality:
                          type: string
                        municipality_id:
                          type: string
                        name:
                          type: string
                        opening_hours:
                          type: string
                        province:
                          type: string
                        province_id:
                          type: string
                        region:
                          type: string
                        region_id:
                          type: string
                        side:
                          type: string
                        station_id:
                          type: string
                        zip_code:
                          type: string
                        prices_at:
                          type: string
                        latitude:
                          type: number
                        longitude:
                          type: number
                        fuel_prices:
                          type: array
                          items:
                            type: object
                            properties:
                              fuel_type:
                                type: string
                              price_per_liter:
                                type: number
                              currency:
                                type: string
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Fuel type is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'fuel_type: is incorrect or missing'
                    status: error
  /v1/services/astaraplay/fuel-stations/in-bbox:
    post:
      summary: Retrieve fuel stations in a certain bounding box area for a list of
        countries.
      description: 'This endpoint returns all the fuel stations in a certain bounding
        box area, for a given list of countries, and for a given fuel type. If a location
        is specified, the straight-line distance from the location to each retrieved
        fuel station will be calculated.

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fuel_type:
                  description: A valid fuel type that will be used to filter the fuel
                    stations
                  type: string
                  enum:
                  - biodiesel
                  - bioethanol
                  - cng
                  - lng
                  - lpg
                  - diesel_a
                  - diesel_a_premium
                  - diesel_b
                  - gasoline_93_e10
                  - gasoline_95_e10
                  - gasoline_95_e5
                  - gasoline_95_e5_premium
                  - gasoline_97_e10
                  - gasoline_98_e10
                  - gasoline_98_e5
                  - hydrogen
                  - gasoline_mix_2_stroke
                  example: gasoline_95_e5
                country_codes:
                  description: 'A list of valid country codes by which service stations
                    will be filtered. Country codes available: ESP - Spain, CHL -
                    Chile, PRT - Portugal.

                    '
                  type: array
                  items:
                    type: string
                    enum:
                    - ESP
                    - CHL
                    - PRT
                bbox:
                  description: A bounding box that represents the region within which
                    fuel stations are to be searched.
                  type: object
                  example:
                    location:
                    - -3.69229
                    - 40.445512
                    bounds:
                    - - -3.734665
                      - 40.401471
                    - - -3.666
                      - 40.430485
                  properties:
                    location:
                      description: An array of coordinates, written in the format
                        [longitude, latitude], defines a specific location that could
                        be outside of the designated bounding box. This facilitates
                        the computation of straight-line distances to the retrieved
                        fuel stations within the designated bounding box.
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        example:
                        - -3.69229
                        - 40.445512
                    bounds:
                      description: An array of coordinate pairs, written in the format
                        [longitude, latitude], localizing the corners of the bounding
                        box in the order of [southwest, northeast].
                      type: array
                      example:
                      - - -3.734665
                        - 40.401471
                      - - -3.666
                        - 40.430485
                      minItems: 2
                      maxItems: 2
                      items:
                        type: array
                        minItems: 2
                        maxItems: 2
                        items:
                          type: number
                          example:
                          - -3.734665
                          - 40.401471
                          - -3.666
                          - 40.430485
                  required:
                  - bounds
              required:
              - fuel_type
              - bbox
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  fuel_types:
                    description: All the fuel_types available in at least one fuel
                      station in the bounding box
                    type: array
                    items:
                      type: string
                  fuel_stations:
                    description: Fuel stations offering the requested fuel type found
                      in the bounding box.
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        address:
                          type: string
                        brand:
                          type: string
                        country_code:
                          type: string
                        locality:
                          type: string
                        municipality:
                          type: string
                        municipality_id:
                          type: string
                        name:
                          type: string
                        opening_hours:
                          type: string
                        province:
                          type: string
                        province_id:
                          type: string
                        region:
                          type: string
                        region_id:
                          type: string
                        side:
                          type: string
                        station_id:
                          type: string
                        zip_code:
                          type: string
                        prices_at:
                          type: string
                        latitude:
                          type: number
                        longitude:
                          type: number
                        fuel_prices:
                          type: array
                          items:
                            type: object
                            properties:
                              fuel_type:
                                type: string
                              price_per_liter:
                                type: number
                              currency:
                                type: string
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Fuel type is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'fuel_type: is incorrect or missing'
                    status: error
  /v1/services/data-api/emissions_CO2/calculate/:
    post:
      summary: Computes the CO2 emissions per trip for a given vehicle and then aggregates
        the emissions for each day.
      description: 'This endpoint performs CO2 emission calculations in grams for
        a vehicle''s trips and provides cumulative daily emissions.

        The process involves extracting WLTP (Worldwide Harmonized Light Vehicles
        Test Procedure) value using the Vehicle Identification Number (VIN),

        followed by multiplying WLTP value by the distance traveled during each trip
        undertaken to determine the associated CO2 emissions for that particular trip.


        The response contains the start date and time, distances, and CO2 emissions
        for the trips (emissions_per_trip).

        In addition, It contains a compilation of the distances traveled and emissions
        produced each day (emissions_per_day).


        The call must include a _tracker_oid_list_ with at least one _tracker_oid_.
        By default, all the available data is used for calculation.

        By providing the optional parameters _start_date_ and/or _end_date_, only
        the data within the specified time range is considered.

        This can be useful, for example, to track the CO2 emissions over time.


        By default, the endpoint will be tolerant against missing data within individual
        trackers and continue evaluation for the other trackers.

        The individial error codes will then be included within the response.

        If a stricter error handling is preferred, e.g. when the list contains only
        a single tracker, the optional parameter _robust_output_ can be set to False.

        Then, the endpoint will immediately return any error.


        Note: For models that are not commercialized in Spain, data availability may
        be limited.

        '
      tags:
      - Data API
      security:
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              properties:
                tracker_oid_list:
                  type: array
                start_time:
                  type: string
                end_time:
                  type: string
                robust_output:
                  type: boolean
              required:
              - tracker_oid_list
            examples:
              Valid data:
                value:
                  tracker_oid_list:
                  - 4b8ddef4-3f4a-224c-89bd-9669e9631a11
                  - b5bdb8df-cfc2-225e-b2ba-f6343945f560
                  - d77923a5-a4e2-4154-bee7-115719d4dd94
                  start_time: '2023-01-01 00:00:00'
                  end_time: '2024-05-30 00:00:00'
                  robust_output: true
      responses:
        '200':
          description: 'OK - The response includes a JSON file containing the result.

            '
          content:
            application/json:
              examples:
                Successfully generated result:
                  value:
                    CO2 Emissions:
                      4b8ddef4-3f4a-224c-89bd-9669e9631a11:
                        emissions_per_day: null
                        emissions_per_trip: null
                        error: 404
                        msg: No vin number within tracker_oid data
                      b5bdb8df-cfc2-225e-b2ba-f6343945f560:
                        emissions_per_day: null
                        emissions_per_trip: null
                        error: 404
                        msg: Can not find WLTP value
                      d77923a5-a4e2-4154-bee7-115719d4dd94:
                        emissions_per_day:
                        - co2_Emissions_g_accum: 6329.92
                          date: '2023-07-18'
                          distance_accum: 41.92
                        - co2_Emissions_g_accum: 7839.92
                          date: '2023-07-19'
                          distance_accum: 51.92
                        - co2_Emissions_g_accum: 161.57
                          date: '2024-05-27'
                          distance_accum: 1.07
                        emissions_per_trip:
                        - co2_Emissions_g: 0.0
                          distance: 0.0
                          end_date: 2023-07-18 12:42
                          start_date: 2023-07-18 12:41
                        - co2_Emissions_g: 0.0
                          distance: 0.0
                          end_date: 2023-07-18 12:45
                          start_date: 2023-07-18 12:45
                        - co2_Emissions_g: 169.12
                          distance: 1.12
                          end_date: 2024-05-25 04:07
                          start_date: 2024-05-25 03:58
                        - co2_Emissions_g: 161.57
                          distance: 1.07
                          end_date: 2024-05-27 19:00
                          start_date: 2024-05-27 18:57
        '400':
          description: 'One of the required request body inputs is missing.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Tracker_OID is missing:
                  value:
                    msg: tracker_oid is missing.
                    http_code: 400
                    err_code: null
        '404':
          description: 'No data.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                tracker_oid no found:
                  value:
                    msg: No data, tracker_oid not found.
                    http_code: 404
                    err_code: null
                No vin number within tracker_oid data:
                  value:
                    msg: No data, No vin number within tracker_oid data.
                    http_code: 404
                    err_code: null
                Can not find WLTP value:
                  value:
                    msg: No data, Can not find WLTP value.
                    http_code: 404
                    err_code: null
        '415':
          description: 'Incorrect data format.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                tracker_oid format is wrong:
                  value:
                    msg: Incorrect data format in tracker_oid.
                    http_code: 415
                    err_code: null
                start_time date format is wrong:
                  value:
                    msg: Incorrect data format in start_time.
                    http_code: 415
                    err_code: null
                end_time date format is wrong:
                  value:
                    msg: Incorrect data format in end_time.
                    http_code: 415
                    err_code: null
  /v1/services/open-weather-map/current-weather/:
    post:
      summary: Current weather in a location.
      description: 'This endpoint returns the current weather in a location defined
        by the latitude and longitude.

        Data is given in metric measurement system.

        '
      tags:
      - Open Weather Map
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
              required:
              - latitude
              - longitude
            examples:
              Valid format:
                value:
                  latitude: 40.4165
                  longitude: -3.70256
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              examples:
                Correct response:
                  value:
                    data:
                      clouds:
                        all: 0
                      coord:
                        lat: 40.4167
                        lon: -3.7036
                      dt: 1681465762
                      main:
                        feels_like: 13.2
                        humidity: 54
                        pressure: 1019
                        temp: 14.3
                        temp_max: 15.68
                        temp_min: 12.51
                      name: Sol
                      sys:
                        country: ES
                        sunrise: 1681450706
                        sunset: 1681498290
                      timezone: 7200
                      visibility: 10000
                      weather:
                      - description: clear sky
                        main: Clear
                      wind:
                        deg: 260
                        speed: 7.2
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Latitude is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'latitude: is incorrect or missing'
                    status: error
        '403':
          description: Open weather map credential is not working.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Open weather map credential is not working:
                  value:
                    error: 403
                    http_code: 403
                    msg: Open weather map credential is not working.
                    status: error
  /v1/services/open-charge-map/bbox-poi-list/:
    post:
      summary: Retrieve charge points in a boundary box created with a radius, by
        default of 500m, from a point.
      description: 'This endpoint returns all the charge points in a boundary box
        created with a radius, by default of 500m, from a point.

        The endpoint can return a maximum of 100 charge points, independently of the
        radius.

        '
      tags:
      - Open Charge Map
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
                radius:
                  type: number
              required:
              - latitude
              - longitude
            examples:
              Without radius:
                value:
                  latitude: 40.4165
                  longitude: -3.70256
              With radius:
                value:
                  latitude: 40.4165
                  longitude: -3.70256
                  radius: 500
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              examples:
                Correct response:
                  value:
                    data:
                    - address_info:
                        access_comments: None
                        address_line1: calle de la abada
                        address_line2: None
                        contact_email: None
                        contact_telephone1: None
                        contact_telephone2: None
                        country:
                          continent_code: eu
                          iso_code: es
                          title: spain
                        distance: None
                        distance_unit: 0
                        latitude: 40.419585448948
                        longitude: -3.7048394739123296
                        postcode: '28013'
                        related_url: None
                        state_or_province: comunidad de madrid
                        title: el corte inglés callao
                        town: None
                      connections:
                      - amps: None
                        comments: None
                        connection_type:
                          formal_name: iec 62196-2
                          is_discontinued: false
                          is_obsolete: false
                          title: 'type 2 (tethered connector) '
                        current_type:
                          description: alternating current - three phase
                          title: ac (three-phase)
                        level:
                          comments: over 2 kw, usually non-domestic socket type
                          is_fast_charge_capable: false
                          title: 'level 2 : medium (over 2kw)'
                        power_kw: 11.0
                        quantity: 3
                        reference: None
                        status_type:
                          is_operational: true
                          is_user_selectable: true
                          title: operational
                        voltage: None
                      data_provider:
                        comments: None
                        data_provider_status_type:
                          is_provider_enabled: true
                          title: manual data entry
                        date_last_imported: None
                        is_approved_import: true
                        is_open_data_licensed: true
                        is_restricted_edit: false
                        license: licensed under creative commons attribution 4.0 international
                          (cc by 4.0)
                        title: open charge map contributors
                        website_url: http://openchargemap.org
                      data_providers_reference: None
                      data_quality_level: 1
                      date_created: 2022-03-02t16:10:00z
                      date_last_confirmed: None
                      date_last_status_update: 2022-11-18t10:04:00z
                      date_last_verified: 2022-11-18t10:04:00z
                      date_planned: None
                      general_comments: None
                      is_recently_verified: true
                      media_items:
                      - comment: ''
                        date_created: 2022-11-18t10:04:00z
                        is_enabled: true
                        is_external_resource: false
                        is_featured_item: false
                        is_video: false
                        item_thumbnail_url: https://s3-ap-southeast-2.amazonaws.com/openchargemap/images/es/ocm191830/ocm-191830.thmb.2022111810034365.jpg
                        item_url: https://s3-ap-southeast-2.amazonaws.com/openchargemap/images/es/ocm191830/ocm-191830.orig.2022111810034365.jpg
                        metadata_value: None
                      metadata_values: None
                      number_of_points: 3
                      operator_info:
                        address_info: None
                        booking_url: None
                        comments: for use when the operator of the equipment is a
                          single business owner connected to the location and equipment
                          is not part of a larger network
                        contact_email: None
                        fault_report_email: None
                        is_private_individual: false
                        is_restricted_edit: None
                        phone_primary_contact: None
                        phone_secondary_contact: None
                        title: (business owner at location)
                        website_url: None
                      operators_reference: None
                      percentage_similarity: None
                      status_type:
                        is_operational: true
                        is_user_selectable: true
                        title: operational
                      submission_status:
                        is_live: true
                        title: submission published
                      usage_cost: None
                      usage_type:
                        is_access_key_required: None
                        is_membership_required: None
                        is_pay_at_location: None
                        title: public
                      user_comments: None
                      uuid: 2e2bacde-7250-4593-b18e-0cafcaa7fd8a
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Latitude is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'latitude: is incorrect or missing'
                    status: error
        '403':
          description: Open charge map credential is not working.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Open charge map credential is not working:
                  value:
                    error: 403
                    http_code: 403
                    msg: Open charge map credential is not working.
                    status: error
  /v1/services/open-charge-map/poi-list/:
    post:
      summary: Retrieve charge points in a radius, by default of 0.5 km, from a point.
      description: 'This endpoint returns all the charge points in a radius (in km),
        by default of 0.5 km, from a point.

        The endpoint can return a maximum of 100 charge points, independently of the
        radius.

        '
      tags:
      - Open Charge Map
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
                radius:
                  type: number
              required:
              - latitude
              - longitude
            examples:
              Without radius:
                value:
                  latitude: 40.4165
                  longitude: -3.70256
              With radius:
                value:
                  latitude: 40.4165
                  longitude: -3.70256
                  radius: 0.7
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              examples:
                Correct response:
                  value:
                    data:
                    - address_info:
                        access_comments: None
                        address_line1: calle de la abada
                        address_line2: None
                        contact_email: None
                        contact_telephone1: None
                        contact_telephone2: None
                        country:
                          continent_code: eu
                          iso_code: es
                          title: spain
                        distance: None
                        distance_unit: 0
                        latitude: 40.419585448948
                        longitude: -3.7048394739123296
                        postcode: '28013'
                        related_url: None
                        state_or_province: comunidad de madrid
                        title: el corte inglés callao
                        town: None
                      connections:
                      - amps: None
                        comments: None
                        connection_type:
                          formal_name: iec 62196-2
                          is_discontinued: false
                          is_obsolete: false
                          title: 'type 2 (tethered connector) '
                        current_type:
                          description: alternating current - three phase
                          title: ac (three-phase)
                        level:
                          comments: over 2 kw, usually non-domestic socket type
                          is_fast_charge_capable: false
                          title: 'level 2 : medium (over 2kw)'
                        power_kw: 11.0
                        quantity: 3
                        reference: None
                        status_type:
                          is_operational: true
                          is_user_selectable: true
                          title: operational
                        voltage: None
                      data_provider:
                        comments: None
                        data_provider_status_type:
                          is_provider_enabled: true
                          title: manual data entry
                        date_last_imported: None
                        is_approved_import: true
                        is_open_data_licensed: true
                        is_restricted_edit: false
                        license: licensed under creative commons attribution 4.0 international
                          (cc by 4.0)
                        title: open charge map contributors
                        website_url: http://openchargemap.org
                      data_providers_reference: None
                      data_quality_level: 1
                      date_created: 2022-03-02t16:10:00z
                      date_last_confirmed: None
                      date_last_status_update: 2022-11-18t10:04:00z
                      date_last_verified: 2022-11-18t10:04:00z
                      date_planned: None
                      general_comments: None
                      is_recently_verified: true
                      media_items:
                      - comment: ''
                        date_created: 2022-11-18t10:04:00z
                        is_enabled: true
                        is_external_resource: false
                        is_featured_item: false
                        is_video: false
                        item_thumbnail_url: https://s3-ap-southeast-2.amazonaws.com/openchargemap/images/es/ocm191830/ocm-191830.thmb.2022111810034365.jpg
                        item_url: https://s3-ap-southeast-2.amazonaws.com/openchargemap/images/es/ocm191830/ocm-191830.orig.2022111810034365.jpg
                        metadata_value: None
                      metadata_values: None
                      number_of_points: 3
                      operator_info:
                        address_info: None
                        booking_url: None
                        comments: for use when the operator of the equipment is a
                          single business owner connected to the location and equipment
                          is not part of a larger network
                        contact_email: None
                        fault_report_email: None
                        is_private_individual: false
                        is_restricted_edit: None
                        phone_primary_contact: None
                        phone_secondary_contact: None
                        title: (business owner at location)
                        website_url: None
                      operators_reference: None
                      percentage_similarity: None
                      status_type:
                        is_operational: true
                        is_user_selectable: true
                        title: operational
                      submission_status:
                        is_live: true
                        title: submission published
                      usage_cost: None
                      usage_type:
                        is_access_key_required: None
                        is_membership_required: None
                        is_pay_at_location: None
                        title: public
                      user_comments: None
                      uuid: 2e2bacde-7250-4593-b18e-0cafcaa7fd8a
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Latitude is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'latitude: is incorrect or missing'
                    status: error
        '403':
          description: Open charge map credential is not working.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Open charge map credential is not working:
                  value:
                    error: 403
                    http_code: 403
                    msg: Open charge map credential is not working.
                    status: error
  /v1/services/astaraplay/fuel-estimation:
    post:
      summary: Obtain autonomy range estimations for a given route.
      description: 'This endpoint returns an estimation of the autonomy range in a
        route. It returns the autonomy as a value, as well as GeoJSON LineStrings
        representing the sections of the route in which the tank reserve is not reached,
        and the section of the route that will be done with the tank reserve.

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                route:
                  description: A GeoJSON of a LineString representing the route to
                    estimate
                  type: object
                  properties:
                    coordinates:
                      description: Array of coordinate pairs (in the form [longitude,
                        latitude]) of describing the points in the route.
                      type: array
                      items:
                        type: array
                        items:
                          type: number
                        maxItems: 2
                        minItems: 2
                    type:
                      type: string
                      enum:
                      - LineString
                  required:
                  - coordinates
                consumption_per_100km:
                  description: The average fuel consumption of the vehicle, in liters
                    per 100km
                  type: number
                vehicle_capacity:
                  description: The total tank capacity of the vehicle, in liters
                  type: number
                current_tank_pct:
                  description: The current fuel level of the vehicle. Must be a value
                    between 0 (empty) and 1 (full)
                  type: number
                  minimum: 0
                  maximum: 1
                styles:
                  description: Style properties for the GeoJSON LineStrings with the
                    estimate sections (orig, reserve, tank) that the response will
                    include.
                  type: object
                  properties:
                    orig:
                      description: Style properties for the original (full) route
                      type: object
                      properties:
                        stroke:
                          type: string
                        stroke-width:
                          type: number
                        stroke-opacity:
                          type: number
                    tank:
                      description: Style properties for section of the route before
                        hitting the tank reserve
                      type: object
                      properties:
                        stroke:
                          type: string
                        stroke-width:
                          type: number
                        stroke-opacity:
                          type: number
                    reserve:
                      description: Style properties for the tank reserve section
                      type: object
                      properties:
                        stroke:
                          type: string
                        stroke-width:
                          type: number
                        stroke-opacity:
                          type: number
              required:
              - route
              - consumption_per_100km
              - vehicle_capacity
              - current_tank_pct
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_distance:
                    description: Total distance of the route, in meters
                    type: number
                  range_with_current_fuel:
                    description: Range with current fuel in tank, in meters
                    type: number
                  range_until_reserve:
                    description: Range before hitting the tank reserve, in meters
                    type: number
                  range_in_reserve:
                    description: Range after hitting the tank reserve and until fuel
                      runs out, in meters
                    type: number
                  geojson:
                    description: GeoJSON with a FeatureCollection containing the 3
                      LineString Features with full route, before reserve section,
                      and after reserve sections of the route. They include the styles
                      passed in the request as properties.
                    type: object
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Consumtpion per 100km is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'consumption_per_100km: is incorrect or missing'
                    status: error
  /v1/services/astaraplay/fuel-stations/{station_id}/metrics:
    get:
      summary: Fuel station prices metrics.
      description: 'This endpoint returns the average and standard deviation of available
        fuel prices for each day of the week, based on a specified station and fuel
        type. To get station_id, please refer to our [Docs 1](https://docs.astaraconnect.com/reference/post_v1-services-astaraplay-fuel-stations-in-route),
        or [Docs 2](https://docs.astaraconnect.com/reference/post_v1-services-astaraplay-fuel-stations-in-bbox).

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      parameters:
      - in: path
        name: station_id
        description: Unique identifier of the fuel station.
        required: true
        schema:
          type: string
      - in: query
        name: fuel_type
        description: A valid fuel type.
        required: true
        schema:
          type: string
          enum:
          - biodiesel
          - bioethanol
          - cng
          - lng
          - lpg
          - diesel_a
          - diesel_a_premium
          - diesel_b
          - gasoline_93_e10
          - gasoline_95_e10
          - gasoline_95_e5
          - gasoline_95_e5_premium
          - gasoline_97_e10
          - gasoline_98_e10
          - gasoline_98_e5
          - hydrogen
          - gasoline_mix_2_stroke
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        avg:
                          type: number
                          description: average price per liter for this day of week
                        std:
                          type: number
                          description: standard deviation of the price per liter for
                            this day of week
                        dow:
                          type: integer
                          description: day of the week. From Monday (1) to Sunday
                            (7)
        '404':
          description: The fuel station was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Fuel station not found:
                  value:
                    error: 404
                    msg: Not found
                    http_code: 404
                    status: error
        '415':
          description: Invalid or missing field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Fuel type is incorrect or missing:
                  value:
                    error: 415
                    http_code: 415
                    msg: 'fuel_type: is incorrect or missing'
                    status: error
  /v1/services/astaraplay/fuel-stations/{station_id}:
    get:
      summary: Fuel station information.
      description: 'This endpoint returns the fuel station information provided by
        Astara Play for a given station id.To get station_id, please refer to our
        [Docs 1](https://docs.astaraconnect.com/reference/post_v1-services-astaraplay-fuel-stations-in-route),
        or [Docs 2](https://docs.astaraconnect.com/reference/post_v1-services-astaraplay-fuel-stations-in-bbox).

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      parameters:
      - in: path
        name: station_id
        description: Unique identifier of the fuel station.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  address:
                    type: string
                  brand:
                    type: string
                  country_code:
                    type: string
                  locality:
                    type: string
                  municipality:
                    type: string
                  municipality_id:
                    type: string
                  name:
                    type: string
                  opening_hours:
                    type: string
                  province:
                    type: string
                  province_id:
                    type: string
                  region:
                    type: string
                  region_id:
                    type: string
                  side:
                    type: string
                  station_id:
                    type: string
                  zip_code:
                    type: string
                  prices_at:
                    type: string
                  latitude:
                    type: number
                  longitude:
                    type: number
                  fuel_prices:
                    type: array
                    items:
                      type: object
                      properties:
                        fuel_type:
                          type: string
                        price_per_liter:
                          type: number
                        currency:
                          type: string
        '404':
          description: The fuel station was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Fuel station not found:
                  value:
                    error: 404
                    msg: Not found
                    http_code: 404
                    status: error
  /v1/services/astaraplay/vehicle-info/{license_plate}:
    get:
      summary: Vehicle information.
      description: 'This endpoint returns the vehicle information provided by Astara
        Play for a given license plate.

        '
      tags:
      - Astara Play
      security:
      - BearerAuth:
        - read
      - ApiKeyAuth:
        - read
      parameters:
      - in: path
        name: license_plate
        description: License plate number of the vehicle to query.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  category:
                    type: string
                  license_plate:
                    type: string
                  sticker:
                    type: string
                  vehicle_type:
                    type: string
                  license_registration_date:
                    type: object
                    properties:
                      month:
                        type: integer
                      year:
                        type: integer
        '404':
          description: No vehicle found for the given license plate number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exception'
              examples:
                Vehicle not found:
                  value:
                    error: 404
                    msg: Not found
                    http_code: 404
                    status: error
info:
  title: Services
  version: 1.213.0
openapi: 3.0.2
components:
  schemas:
    Exception:
      type: object
      properties:
        status:
          type: string
        error:
          type: number
        err_code:
          type: string
        msg:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
        msg:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-BOTON-APIKEY
