Get a sneak peek at whats next for Permanent Hazards on our April 7th Office Hours!
These forums are specific to the Waze mobile app. Post here if you experienced a problem while using the app, have a question about the app functionality or a feature such as navigation or search.

Post Reply
Forum rules
Waze App Useful Resources

api for getting my location.

Post by leifnei
Is there a way to get my approximate location for an external server on the internet?

I can make a script to reroute my office deskphone to my home deskphone, but I'd like to be able to determine by querying waze server, if I'm somewhere near office or home.

A margin of 50km is good enough :-)

I'm always using waze; my speedometer is deliberately lying to me, even when the OBD-readout is true.
leifnei
Posts: 83
Has thanked: 1 time
Been thanked: 3 times

POSTER_ID:2564864

1

Send a message

Post by dknight212
There is no API for providing the location from Waze, though you might be able to hack something together using the share my drive feature. Alternatively, if you're on Android then something like Tasker will be able to help determine your position and notify your server in some way. I'm sure there must be alternatives on the other OSs.
dknight212
Posts: 4962
Has thanked: 367 times
Been thanked: 603 times
Send a message

Post by dknight212
There is likely to be a delay of a few minutes due to privacy reasons, I'm sure you'd be better off with the phone itself initiating a location report to your server.
dknight212
Posts: 4962
Has thanked: 367 times
Been thanked: 603 times
Send a message

Post by dknight212
I'm not even sure all users are provided by the live map feed.

Edit: I'll get someone who knows these things to post.
dknight212
Posts: 4962
Has thanked: 367 times
Been thanked: 603 times
Send a message

Post by leifnei
I think I can hack something together with getting the data sent to the live map webpage:

https://www.waze.com/row-rtserver/web/G ... 2119958550

It returns a nice json, with the location of users:

{"fleet":"none",
"id":"user-477349956/b02a540ec273-45c9-9253-02334400aeb2",
"inscale":true,
"speed":25.35386477446572,
"location":{"y":55.609500000000004,"x":12.3165},
"ingroup":false,
"addon":3,
"mood":1,
"userName":"guest",
"ping":1,"magvar":0},

I just have to find my own userid; I guess I have to start making requests and store the response, and then make a drive to see if I show up in the response; there is noone in my area now.
leifnei
Posts: 83
Has thanked: 1 time
Been thanked: 3 times
Send a message

Post by leifnei
A delay does not matter, the phone doesn't ring that much.
I don't want to have to remember to start yet another app on my phone, then I might as well rember to press a few buttons on my home desk-phone.
Simply: If I pass through area X between 8 and 9 am, do not relay work calls to my home phone.

But the big question: is my userid in this output constant? I'm not sure, having analyzed half an hour of data while I was out driving.
leifnei
Posts: 83
Has thanked: 1 time
Been thanked: 3 times
Send a message

Post by Timbones
I don't think you can rely on Waze being able to provide you with useful location information.
There are other services that will be more reliable/useful.

Which OS is your phone on? Where is your script going to be running? Are you behind a firewall?

Two suggestions:
  1. Setup app like Tasker on phone to (automatically) notify your script about its location. Monitoring which Wifi network is connectect will probably enough. When you leave home (disconnect from Wifi), your mobile will tell your script at work to redirect.
  2. Have the script monitor your Work wifi network, and when it sees your mobile phone appear on it, redirect the telephone.
Timbones
Coordinators
Coordinators
Posts: 7357
Answers: 2
Has thanked: 952 times
Been thanked: 2916 times
Send a message
Timbones(6) • UK Coordinator • Forum Moderator • Closure Monitor
Scripts: WME Colour HighlightsWME Route TesterWME Geometries