Is it possible to get the geo location from where ...
# ask-ai
e
Is it possible to get the geo location from where the session is initiated ?
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can get geographic info for a participant. The Analytics API’s session details include per-participant fields
location
(city/country-like info) and
region
(the data-center/region the participant connected to). You can fetch this after the session via the Analytics API session details endpoint, or access participant location/region during an agent session via participant metadata in the SDKs. Would you like the exact Analytics API endpoint and a sample response JSON? Sources: Analytics API | LiveKit docs | SIP participant | LiveKit docs
e
Is it possible to get the location without using the analytics api, i am using livekit web with python.
t
You're asking if you can get a participant's location without using the Analytics API while using LiveKit Web with a Python backend. Yes — but LiveKit's SDKs do not automatically expose the Analytics `location`/`region` fields in real time. You can get location without the Analytics API by having your app supply it or infer it yourself. Options: • Client-reported geolocation (recommended for real-time, accurate location) a. On the web client, use the browser Geolocation API to get latitude/longitude. b. Send those values to LiveKit as participant attributes or metadata (e.g.,
localParticipant.setAttributes({...})
). c. Read attributes from the Python side via the participant object. • IP-based geolocation (server-side inference) a. Capture the client IP in your join/token endpoint (e.g., request.remote_addr or X-Forwarded-For). b. Query an IP geolocation service (MaxMind, IPinfo, etc.). c. Store/send that info as participant metadata/attributes when creating the token or when the participant joins. • SIP-specific attributes (only if using SIP) Use SIP fields (phoneNumber, callSid, etc.) plus telecom lookup services to infer location, then attach to participant attributes. If you’d like, I can: • Show a short code snippet for setting attributes from the browser and reading them in Python, or • Show an example token-generation flow that embeds inferred IP geolocation into participant metadata. Which would help you most? Sources: Analytics API | LiveKit docs | Tool definition and use | LiveKit docs | Managing participants | LiveKit docs | SIP participant | LiveKit docs