> For the complete documentation index, see [llms.txt](https://docs.eseye.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eseye.com/api-reference/api-reference-legacy/location/sim-location.md).

# SIM Location

## Locate a SIM

> Interrogates the network for current location information. If the device is\
> offline, or the current location is not available, returns the last recorded\
> value.\
> \
> Identify the SIM using either \`iccid\` or \`msisdn\`.\
> \
> \*\*Optional fields\*\*\
> \
> Send \`null\` without quotes for any object you do not want to set. The value\
> remains as previously set. To set a new value, replace \`null\` with the value in\
> quotes. To remove an existing value, send an empty string.<br>

```json
{"openapi":"3.1.0","info":{"title":"Location API","version":"1.0"},"tags":[{"name":"SIM location"}],"servers":[{"url":"https://location.eseye.com","description":"Production"}],"security":[{"sessionCookie":[]}],"components":{"securitySchemes":{"sessionCookie":{"type":"apiKey","in":"cookie","name":"PHPSESSID","description":"The session cookie established when the user logs in. Sent as\n`Cookie: PHPSESSID=<CookieNumber>`.\n\nThe Location API username and password are sent separately, in the request\nbody of each call.\n"}},"schemas":{"LocateDeviceRequest":{"allOf":[{"$ref":"#/components/schemas/Credentials"},{"type":"object","properties":{"request_id":{"type":"string","description":"A request identifier for tracking responses."},"iccid":{"type":"string","description":"The unique Integrated Circuit Card Identifier of the SIM you want to\nlocate. Use either this parameter or `msisdn`.\n"},"msisdn":{"type":"string","description":"The unique primary SIM phone number (Mobile Station International ISDN\nNumber) of the SIM you want to locate. Use either this parameter or\n`iccid`.\n"}},"anyOf":[{"required":["iccid"]},{"required":["msisdn"]}]}]},"Credentials":{"type":"object","properties":{"username":{"type":"string","description":"The Eseye-assigned Location API username."},"password":{"type":"string","format":"password","description":"The Eseye-assigned Location API password."}},"required":["username","password"]},"LocateDeviceResponse":{"type":"object","properties":{"iccid":{"type":"string","description":"The unique Integrated Circuit Card Identifier for the located SIM."},"msisdn":{"type":"string","description":"The unique primary SIM phone number (Mobile Station International ISDN\nNumber).\n"},"lat":{"type":"number","format":"double","description":"Latitude value of the last cell mast that the SIM used."},"lon":{"type":"number","format":"double","description":"Longitude value of the last cell mast that the SIM used."},"countryname":{"type":"string","description":"The last recorded country the SIM was in."},"countrycode":{"type":"string","description":"The ISO 3166 Alpha-2 code of the last recorded country the SIM was in.\n"},"timezone":{"type":"string","description":"The TZ database name of the last recorded time zone the SIM was in.\n"},"status":{"$ref":"#/components/schemas/Status"},"request_id":{"type":"string","description":"The returned request identifier, for tracking responses."}}},"Status":{"type":"object","description":"Details about the request status.","properties":{"status":{"type":"string","description":"`OK` when the request processed successfully, `ERR` when the request failed.\n","enum":["OK","ERR"]},"errorCode":{"type":"string","description":"Empty when the request processed successfully. Otherwise the specific error\ncode.\n"},"errorMessage":{"type":"string","description":"Empty when the request processed successfully. Otherwise an explanation of\nthe error.\n"}}}}},"paths":{"/index/locatedevice":{"post":{"operationId":"locateDevice","tags":["SIM location"],"summary":"Locate a SIM","description":"Interrogates the network for current location information. If the device is\noffline, or the current location is not available, returns the last recorded\nvalue.\n\nIdentify the SIM using either `iccid` or `msisdn`.\n\n**Optional fields**\n\nSend `null` without quotes for any object you do not want to set. The value\nremains as previously set. To set a new value, replace `null` with the value in\nquotes. To remove an existing value, send an empty string.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocateDeviceRequest"}}}},"responses":{"200":{"description":"The request was processed. Check `status.status` to determine whether the\nlookup succeeded.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocateDeviceResponse"}}}}}}}}}
```

## Export SIM locations as a KMZ file

> Returns a compressed Keyhole Markup Language (KMZ) file detailing the Google\
> Earth location of one or more SIMs. Install Google Earth or Google My Maps to\
> import the file and view the mapped locations.\
> \
> Limit each request to a maximum of 10 ICCIDs to reduce load on the server.\
> \
> In Postman, test the request using Send before you use Send and Download.\
> \
> \*\*Optional fields\*\*\
> \
> Send \`null\` without quotes for any object you do not want to set. The value\
> remains as previously set. To set a new value, replace \`null\` with the value in\
> quotes. To remove an existing value, send an empty string.<br>

```json
{"openapi":"3.1.0","info":{"title":"Location API","version":"1.0"},"tags":[{"name":"SIM location"}],"servers":[{"url":"https://location.eseye.com","description":"Production"}],"security":[{"sessionCookie":[]}],"components":{"securitySchemes":{"sessionCookie":{"type":"apiKey","in":"cookie","name":"PHPSESSID","description":"The session cookie established when the user logs in. Sent as\n`Cookie: PHPSESSID=<CookieNumber>`.\n\nThe Location API username and password are sent separately, in the request\nbody of each call.\n"}},"schemas":{"KmzRequest":{"allOf":[{"$ref":"#/components/schemas/Credentials"},{"type":"object","properties":{"request_id":{"type":"string","description":"A request identifier for tracking responses."},"group":{"type":"string","description":"The group name for the SIMs. If left blank, the request is not limited\nto a group.\n"},"iccid":{"type":"array","description":"The list of one or more SIMs that you want to locate, by Integrated\nCircuit Card Identifier. Search for a maximum of 10 ICCIDs in one\nrequest to reduce the load on the server.\n","maxItems":10,"items":{"type":"string"}}}}]},"Credentials":{"type":"object","properties":{"username":{"type":"string","description":"The Eseye-assigned Location API username."},"password":{"type":"string","format":"password","description":"The Eseye-assigned Location API password."}},"required":["username","password"]},"ErrorResponse":{"type":"object","description":"The body returned when a request fails. See the Location API error codes for the\nmeaning of each `errorCode`.\n","properties":{"status":{"$ref":"#/components/schemas/Status"},"request_id":{"type":"string","description":"The returned request identifier, for tracking responses."}}},"Status":{"type":"object","description":"Details about the request status.","properties":{"status":{"type":"string","description":"`OK` when the request processed successfully, `ERR` when the request failed.\n","enum":["OK","ERR"]},"errorCode":{"type":"string","description":"Empty when the request processed successfully. Otherwise the specific error\ncode.\n"},"errorMessage":{"type":"string","description":"Empty when the request processed successfully. Otherwise an explanation of\nthe error.\n"}}}}},"paths":{"/index/kmz":{"post":{"operationId":"exportKmz","tags":["SIM location"],"summary":"Export SIM locations as a KMZ file","description":"Returns a compressed Keyhole Markup Language (KMZ) file detailing the Google\nEarth location of one or more SIMs. Install Google Earth or Google My Maps to\nimport the file and view the mapped locations.\n\nLimit each request to a maximum of 10 ICCIDs to reduce load on the server.\n\nIn Postman, test the request using Send before you use Send and Download.\n\n**Optional fields**\n\nSend `null` without quotes for any object you do not want to set. The value\nremains as previously set. To set a new value, replace `null` with the value in\nquotes. To remove an existing value, send an empty string.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KmzRequest"}}}},"responses":{"200":{"description":"A compressed KML file containing the mapped SIM locations. Add a `.kml`\nextension to the file name when you save it, then import the file into\nGoogle Earth or Google My Maps to view the SIM locations.\n\nA request that fails returns a JSON body instead of the file. Check\n`status.status` to determine whether the export succeeded.\n","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eseye.com/api-reference/api-reference-legacy/location/sim-location.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
