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

# List Metering Grid Areas

> List & filter Metering Grid Areas.

If you specify multiple values for some filter parameter they are OR-ed. If you specify multiple separate filters they are "AND"-ed.

For instance if you specify country=SE&country=DK, you'll get MGAs in Denmark and Sweden. If you specify country=DK&city=Stockholm you'll get no results as no MGAs cover both Stockholm and Denmark.

See [Metering Grid Area](/api-reference/core/models/metering-grid-area) for details on MeteringGridArea.



## OpenAPI

````yaml /openapi.json get /core/v1/metering-grid-areas
openapi: 3.1.0
info:
  title: Engrate API
  version: 1.0.0
servers:
  - url: https://api.engrate.io
security:
  - apiKeyAuth: []
paths:
  /core/v1/metering-grid-areas:
    get:
      summary: List Metering Grid Areas
      description: >-
        List & filter Metering Grid Areas.


        If you specify multiple values for some filter parameter they are OR-ed.
        If you specify multiple separate filters they are "AND"-ed.


        For instance if you specify country=SE&country=DK, you'll get MGAs in
        Denmark and Sweden. If you specify country=DK&city=Stockholm you'll get
        no results as no MGAs cover both Stockholm and Denmark.


        See [Metering Grid Area](/api-reference/core/models/metering-grid-area)
        for details on MeteringGridArea.
      operationId: list_metering_grid_areas_core_v1_metering_grid_areas_get
      parameters:
        - description: Filter by Engrate metering grid area id(s)
          in: query
          name: id
          required: false
          schema:
            default: []
            description: Filter by Engrate metering grid area id(s)
            items:
              format: uuid
              type: string
            title: Id
            type: array
        - description: Substring filter by name(s) of the metering grid area
          in: query
          name: name
          required: false
          schema:
            default: []
            description: Substring filter by name(s) of the metering grid area
            items:
              type: string
            title: Name
            type: array
        - description: >-
            Filter by [Extra
            Identifier](/api-reference/core/models/extra-identifier)(s)
          in: query
          name: extra_id
          required: false
          schema:
            default: []
            description: >-
              Filter by [Extra
              Identifier](/api-reference/core/models/extra-identifier)(s)
            items:
              type: string
            title: Extra Id
            type: array
        - description: >-
            Filter MGAs operated by the specified
            [Party](/api-reference/core/models/party)(s)
          in: query
          name: system_operator_id
          required: false
          schema:
            default: []
            description: >-
              Filter MGAs operated by the specified
              [Party](/api-reference/core/models/party)(s)
            items:
              format: uuid
              type: string
            title: System Operator Id
            type: array
        - description: >-
            Filter MGAs operated by the specified
            [Party](/api-reference/core/models/party)(s), convenience filter to
            search by extra ids
          in: query
          name: system_operator_extra_id
          required: false
          schema:
            default: []
            description: >-
              Filter MGAs operated by the specified
              [Party](/api-reference/core/models/party)(s), convenience filter
              to search by extra ids
            items:
              type: string
            title: System Operator Extra Id
            type: array
        - description: Filter by country(s)
          in: query
          name: country
          required: false
          schema:
            default: []
            description: Filter by country(s)
            items:
              type: string
            title: Country
            type: array
        - description: >-
            Filter by latitude, requires you to also specify lon; finds MGAs
            that cover the given location
          in: query
          name: lat
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              Filter by latitude, requires you to also specify lon; finds MGAs
              that cover the given location
            title: Lat
        - description: >-
            Filter by longitude, requires you to also specify lat; finds MGAs
            that cover the given location
          in: query
          name: lon
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              Filter by longitude, requires you to also specify lat; finds MGAs
              that cover the given location
            title: Lon
        - description: >-
            Filter by street address, requires that you also specify country and
            city
          in: query
          name: street
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by street address, requires that you also specify country
              and city
            title: Street
        - description: Filter by city, requires you also specify street and country
          in: query
          name: city
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by city, requires you also specify street and country
            title: City
        - description: Filter by zip/postal code, requires you also specify country
          in: query
          name: zipcode
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by zip/postal code, requires you also specify country
            title: Zipcode
      responses:
        '200':
          content:
            application/json:
              example:
                mgas:
                  - extra_ids:
                      - kind: eic
                        value: 46Y000000000016G
                      - kind: se.mga_code
                        value: STO
                    id: 0199c317-25ec-7c00-b1a0-a1b2c3d4e5f6
                    name: Stockholm
                    scheduling_area_eic: 10Y1001A1001A47J
                    system_operator:
                      extra_ids:
                        - kind: eic
                          value: 46X000000000245K
                      id: 0199c317-25ec-7cf7-94cc-32a39f068433
              schema:
                $ref: '#/components/schemas/GetMeteringGridAreasResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    GetMeteringGridAreasResponse:
      properties:
        mgas:
          items:
            $ref: '#/components/schemas/MeteringGridArea'
          title: Mgas
          type: array
      required:
        - mgas
      title: GetMeteringGridAreasResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    MeteringGridArea:
      description: >-
        A Metering Grid Area (MGA) is a core domain concept in the European
        energy market.


        The [ENTSO-E Harmonized Electricity Market Role
        Model](https://www.entsoe.eu/data/cim/role-models/) defines an MGA as:


        > A physical area where consumption, production and exchange can be
        measured. It is delimited by the placement of meters for continuous
        measurement for input to, and withdrawal from the area.


        In other words, an MGA is a collection of Metering Points operated by
        some System Operator, usually a DSO.
      example:
        extra_ids:
          - kind: eic
            value: 46Y000000000016G
          - kind: se.mga_code
            value: STO
        id: 0199c317-25ec-7c00-b1a0-a1b2c3d4e5f6
        name: Stockholm
        scheduling_area_eic: 10Y1001A1001A47J
        system_operator:
          extra_ids:
            - kind: eic
              value: 46X000000000245K
          id: 0199c317-25ec-7cf7-94cc-32a39f068433
      properties:
        extra_ids:
          description: >-
            [Extra Identifiers](/api-reference/core/models/extra-identifier) for
            this MGA
          items:
            $ref: '#/components/schemas/ExtraIdentifier'
          title: Extra Ids
          type: array
        id:
          description: Unique identifier for the MGA
          format: uuid
          title: Id
          type: string
        name:
          description: Name of the metering grid area
          title: Name
          type: string
        scheduling_area_eic:
          description: EIC code for the Scheduling Area this Metering Grid Area belongs to
          title: Scheduling Area Eic
          type: string
        system_operator:
          $ref: '#/components/schemas/Identifier'
          description: The [Party](/api-reference/core/models/party) that operates this MGA
      required:
        - extra_ids
        - id
        - name
        - scheduling_area_eic
        - system_operator
      title: MeteringGridArea
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ExtraIdentifier:
      description: >-
        Extra identifiers are used to attach things like EIC ids, VAT numbers,
        jurisdiction-specific identifiers, etc.


        For example, Metering Grid Area's in parts of Europe are assigned an
        local jurisdiction EIC code; for those MGAs, the Engrate system will
        store the EIC as an extra identifier. However some jurisdictions have
        not yet switched to EIC codes, instead they rely on older local
        identification schemes. Swedish MGAs, as an example, use a local code
        assigned by the Swedish TSO.


        Because the local schemes are subject to collisions - two TSOs assigning
        the same numerical code to different things, as they do not coordinate
        id assignment - we also track an identifier "kind".
      example:
        kind: eic
        value: 46X000000000245K
      properties:
        kind:
          $ref: '#/components/schemas/IdentifierKind'
          description: The kind of identifier
        value:
          description: The identifier value
          title: Value
          type: string
      required:
        - kind
        - value
      title: ExtraIdentifier
      type: object
    Identifier:
      example:
        extra_ids:
          - kind: eic
            value: 46X000000000245K
        id: 0199c317-25ec-7cf7-94cc-32a39f068433
      properties:
        extra_ids:
          description: >-
            [Extra Identifiers](/api-reference/core/models/extra-identifier)
            used to reference this same entity
          items:
            $ref: '#/components/schemas/ExtraIdentifier'
          title: Extra Ids
          type: array
        id:
          description: Unique identifier assigned by Engrate
          format: uuid
          title: Id
          type: string
      required:
        - extra_ids
        - id
      title: Identifier
      type: object
    IdentifierKind:
      enum:
        - eic
        - vat
        - gln
        - se.ediel
        - se.mga_code
        - no.mga_code
        - esett.mga_type
      title: IdentifierKind
      type: string
  securitySchemes:
    apiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````