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

# FAQ: Can I fetch a candidate’s location based on their IP address through the API?

**Yes.** You can retrieve a candidate’s geolocation data (derived from their IP address) through the API.

<Warning>
  Location data is based on IP detection. If a candidate is using a **VPN or proxy**, the returned location may not reflect their real physical location.
</Warning>

## What Location Data Is Available?

For each interview answer, you can retrieve:

* `countryCode`
* `city` (localized name)
* `subdivision` (region/state code and name)

## Query Example

The following query retrieves location data for both video and text questions:

```graphql theme={null}
query InterviewAnswerLocation($id: String!) {
  interview(id: $id) {
    steps(input: {}) {
      ... on InterviewStepVideoQuestionWithVideoAnswer {
        answers(input: { onlyMostRecent: false }) {
          ... on InterviewStepVideoQuestionWithVideoAnswerAnswerInterface {
            location {
              countryCode
              city {
                name {
                  en
                }
              }
              subdivision {
                code
                name {
                  en
                }
              }
            }
          }
        }
      }
      ... on InterviewStepTextQuestionWithVideoAnswer {
        answers(input: { onlyMostRecent: false }) {
          ... on InterviewStepTextQuestionWithVideoAnswerAnswerInterface {
            location {
              countryCode
              city {
                name {
                  en
                }
              }
              subdivision {
                code
                name {
                  en
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Example Response

The response will include location details for each answer:

```json theme={null}
{
  "data": {
    "interview": {
      "steps": [
        {
          "answers": [
            {
              "location": {
                "countryCode": "ES",
                "city": {
                  "name": { "en": "Barcelona" }
                },
                "subdivision": {
                  "code": "CT",
                  "name": { "en": "Catalonia" }
                }
              }
            }
          ]
        }
      ]
    }
  }
}
```

## When Should I Use This?

Use this query if you need to:

* Validate the interview origin region
* Perform compliance checks
* Add fraud detection signals
* Enrich reporting data
