Checking uber surge status from terminal

Because I’m too lazy to pick up the phone and wait for the uber app to load.

We are going to use uber api for this. Create an app and get your server token. In the estimates endpoint you don’t need to pass different start location and end location to get the surge multiplier. (Note that I’m using the v1 of the api. v1.2 doesn’t provide us the surge multiplier since they are showing upfront charges now). Just pass the starting location to check for surge. (Use google maps and check the url to get your lat, long).

Here’s a simple script to get what we need from the api. Don’t forget to replace YOUR_TOKEN with your actual server token from the uber developer dashboard.

Then from your terminal set an alias to the script  with your lat long values.

$ alias surge="/path/to/script/surge.php 6.9328 79.8414722"

Reload the profile to make the new alias work. In my case its;

$ source ~/.zshrc

Next time you want to check if there’s any surge you just have to type surge in your terminal.