Examples | 2GIS Documentation
Twins API

Examples

Get a list of partners, among which you can search for links to 2GIS objects.

https://twins.api.2gis.com/v1/partners?key=APIKEY

As a result, only the partners available for the passed key are displayed.

{
  "meta": {
    "code": 200,
    "message": "ok"
  },
  "result": {
    "items": [
      {
        "code": "sber-food",
        "name": "SberFood"
      },
      {
        "code": "sber-ryadom",
        "name": "SberRyadom"
      }
    ],
    "total": 2
  }
}

Get partner objects based on 2GIS object IDs.

https://twins.api.2gis.com/v1/twins/search/dgis?dgis_id=2674540563776880&dgis_id=1267165676509882&partner_code=sber-food&partner_code=sber-ryadom&key=APIKEY

One-to-one link is not guaranteed, an object in another system may be missing or consist of several.

{
  "meta": {
    "code": 200,
    "message": "ok"
  },
  "result": {
    "items": [
      {
        "dgis_id": "1267165676509882",
        "dgis_type": "branch",
        "twins": [
          {
            "partner_id": "21934",
            "partner_type": "branch",
            "partner_code": "sber-food"
          },
          {
            "partner_id": "21939",
            "partner_type": "branch",
            "partner_code": "sber-food"
          }
        ]
      },
      {
        "dgis_id": "2674540563776880",
        "dgis_type": "branch",
        "twins": [
          {
            "partner_id": "22842",
            "partner_type": "branch",
            "partner_code": "sber-food"
          },
          {
            "partner_id": "23984",
            "partner_type": "branch",
            "partner_code": "sber-food"
          },
          {
            "partner_id": "140000002450",
            "partner_type": "branch",
            "partner_code": "sber-ryadom"
          }
        ]
      }
    ],
    "total": 2
  }
}

Get 2GIS objects by the partner object IDs.

https://twins.api.2gis.com/v1/twins/search/partners?partner_id=21934&partner_id=22842&partner_code=sber-food&key=APIKEY

One-to-one link is not guaranteed, an object in 2GIS may be absent or consist of several.

{
  "meta": {
    "code": 200,
    "message": "ok"
  },
  "result": {
    "items": [
      {
        "partner_id": "22842",
        "partner_type": "branch",
        "twins": [
          {
            "dgis_id": "2674540563776880",
            "dgis_type": "branch"
          }
        ]
      },
      {
        "partner_id": "21934",
        "partner_type": "branch",
        "twins": [
          {
            "dgis_id": "1267165676509882",
            "dgis_type": "branch"
          },
          {
            "dgis_id": "70000001022214983",
            "dgis_type": "branch"
          }
        ]
      }
    ],
    "total": 2
  }
}

Get all links between 2GIS objects and the partner.

https://twins.api.2gis.com/v1/twins/export?partner_code=sber-food&key=APIKEY

The format of response is CSV.

dgis_id,dgis_type,partner_id,partner_type
1267165676509882,branch,21934,branch
1267165676509882,branch,21939,branch
2674540563776880,branch,22842,branch
...