<!--
{
  "documentType" : "article",
  "framework" : "AppStoreConnectAPI",
  "identifier" : "/documentation/AppStoreConnectAPI/getting-geographic-distance",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Getting geographic distance"
}
-->

# Getting geographic distance

Return the relative geographic distance between two match requests.

## Discussion

Use the `geoLatency()` function in the expression of a matchmaking rule to get the geographic distance between two devices that submit match requests. This function uses the location of the players’ devices that the match request contains, but keeps that information private.

### Declaration

```other
number geoLatency(object $request1, object $request2)
```

### Parameters

-`request1`: A match request to compare with `request2`.
-`request2`: A match request to compare with `request1`.

### Return value

A value between `0.0` and `1.0` that represents the relative geographic distance between the player devices that issued these requests, where `0.0` is in the same local area and `1.0` is the longest possible distance.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)