Find geolocation of specified IP address using Google Geocoding instead of IP address of the request - google-geolocation

Is it possible to specify a certain IP address that we want to get the geolocation of it using Google Geocoding instead of relying on the IP address of the requester?

Related

How do sites like Airbnb know my location without my consent?

See screenshot below. Airbnb knew my location was in Los Angeles. I visited the page in incognito mode. I'm not logged in. I did not consent to geolocation via HTML5 (the browser didn't even prompt me). So how do sites like Airbnb know my location?
My guess is with my IP address. If that's the case, could someone show me how I could replicate that if I were to build a site? Is there an API by Google or someone that provides that service? As far as I can tell the majority of Google Maps' API requires some sort of user input.
Airbnb_screenshot
How do sites like Airbnb know my location without my consent?
Through IP Address Geolocation. If you visit https://www.ipinfo.io, you will see that that your geolocation estimate is fairly accurate. But you haven't provided that service any kind of location permission, hence the word "estimate".
For IP Geolocation:
They don't need a permission for IP Geolocation through HTML5
They only need your IP address
To populate the location information from the IP address, the IP geolocation service provider will aggregate data from various sources and perform analytics to come up a with an estimated location which is accurate on a city or postal code level.
But because this data is collected from IP addresses, changing your IP address through a VPN or hosting can result in inaccurate IP geolocation address. But IPinfo can detect VPN usage as well:
disclaimer: I am the developer success manager at IPinfo
Nowadays, it quite common to geolocate users based on their IP addresses. Despite what people may argue, IP geolocation, especially country estimation is really accurate (more than 99% for IP addresses assigned in developed countries).
Some users may hide their real IP address using a proxy. That's why services such as Ipregistry (disclaimer: I run the service) include threat data along with IP geolocation data. This way you can detect suspicious IP addresses.
Getting information is as simple as calling an HTTP endpoint:
https://api.ipregistry.co/?key=tryout

How can I get the IP address of users opening my heroku app?

Is there a way to view the IP addresses of people who have visited my web application which was deployed with heroku? swish-prophet.herokuapp.com
From within your app's code, you can get the IP address of the person making the request using the HTTP_X_FORWARDED_FOR HTTP header.
You can also see that information in your app logs with the heroku logs command.
You can use $_SERVER['REMOTE_ADDR'] with php.
But you need to consider that some users are behind a proxy system, so there's no way to register that users correct address.
Some websites use REMOTE_ADDR such as:
IP Chicken
Mi IP
Meu IP
My IP Address

Google Geocode API IP restrictions

When using IP restrictions for the Geocode API, what IP address should I put there? The IP address returned by a Google search of "What is my I.P."? Or the I.P address of the server where the application/website files are hosted?
I have a website under inMotion Hosting and I tried to put their i.p as in the restrictions, but that doesn't seem to work.
I don't think I have to put the internet I.P address of everybody who visits my website since I cannot know who will visit and where.
Please let me know, I'm confused
you either have to pass ...
a) the server's IP, when geo-coding server-side (PHP API) or
b) the client's IP, when geo-coding client-side (JS API).
the server's IP should be known, for the client-side IP, see this Q&A.
in principle, it's always the IP of the party which actually requests data.

URL shortner Api

I am using URL Shortener API to shorten our mobile app download link. (https://www.googleapis.com/)
We have some restrictions on our server such that we don't allow unrecognized IP access.
So I would like to know what would be the IP range that googles use when the URL is shortened using this API (https://www.googleapis.com/).
This will help us to configure our security settings to allow access to these IP's
google-apis-explorer
When you say "using the URL Shortener API", are you referring to making calls to this API from your server (as in outbound traffic is IP restricted) or using the short URL to reach your server (as in inbound traffic is IP restricted)? I'll go ahead and answer both possibilities, but please clarify if these weren't what you meant.
If you're trying to allow calls to this API from your server with outbound traffic IP restricted
The URL shortener API can be called through any of Google's IP addresses. There's no way to get a list of these because they will vary by location, load balancing, etc. Plus, you wouldn't want to attempt to restrict by IP this way because whitelisting even one of Google's IP addresses would allow calls from your server to all of Google's services. This likely includes any service hosted on Google Cloud, which could be a proxy, meaning literally anything in the world could be called this way; you'd be entirely eliminating IP restrictions on your server.
If you're trying to shorten your server's URLs using this API and your server has inbound traffic IP restricted
You shouldn't need to do anything. These URLs are just domain redirects. In the end, the user ends up visiting your website (server) using its actual long URL (there's no proxying), so just whitelist the allows users' IPs and it should work.

WP7 Get Wi-Fi gateway IP address

Is there someway to get the IP address of the gateway the phone is currently connected to?
I tried searching through the msdn library but did not succeed.
As far as I know there is no API to obtain that information available.

Resources