Accessing API with Apps Scripts, but IP restricted from US region - google-apps-script

I'm trying to access the Binance API from a Google Sheet using a Apps Script function. Unfortunately api.binance.com is restricted from the US and responds with a 451 and api.binance.us does not have the data I require.
Is it possible make the Sheet/script execute the request from a different region?
Alternatively, is there a way to proxy the request via another region? Web proxies don't seem to offer a way to achieve this.

I would recommend looking for an alternative API you can use before you attempt this. You can use proxies (free proxies are not recommended as they are known for reading your traffic) in the region you want (outside of the US in your case) which will only help if the binance API uses your IP address to find your region. If they somehow accept the region as a header or use your timezone to determine your region, you will have to spoof those values.

The solution I'm going with is using a market data service like Coin Market Cap or CoinGecko.

Related

Is it possible to use multiple Google Map Account under same Application?

I have a Web Application, which is hosted under a domain (say www.xx.com) and I have activated Google Map Account (say, MyAccount) for that Application as well. The Google Map Key under MyAccount; I have enabled for JavaScript Map API and Geocoding API only. There is another option in that Application, which uses Places API, which I haven't enabled due to the heavy costing for that what google have. But, one of my client want to use the Places API option and they have suggested me that to use Client Google Map Account (say, ClientAccount) for that particular Option; where I'll use their Map Key (under ClientAccount) while they sign-in into the Application. So, the following questions became relevant;
-Is it possible to use Dynamic Map Key under one Project?
Is there any violation of Terms? if yes,
- What is the alternative I can suggest to the client to achieve this requirement?
NB: I cannot make another instance of the application to host for the client as my services are under SaaS model.
Thanks,
Shenulal
Yes this should be possible, just send the customer's key with your Places API requests, and make sure they whitelist your domain in their key restrictions.

How to Know Geolocation of Client who are using my web application?

I have one web application. I have to know the Geolocation(Longitude & Latitude) of Clients who are using my web application? As per my understanding, I can do it using Html5 Geolocation Apis. But the problem in this scenario is this that it requires client permission. So is there any way I can do it without client permission?
Please let me know if my understanding is wrong about Html5 Geolocation Apis.
Thanks,
Gopal Lal
I have copied this answer from Michael C. from this question.
"Based on http://www.geolocation.com, there is another way to determine the geolocation other than HTML5.
You can load a local database to query geolocation by IP address. No user intervene required because the web server can retrieve the IP address in every connection.
If you are looking for ZIP code information, then there is at least one vendor available immediately in the market. You can visit http://www.ip2location.com (DB9)."
Have you tried the Google Geocoding API? Its pretty much useful and accurate as well.
Also, you can use the Google Maps API for the same purpose. Refer to an example here.
I'm not sure if I understand 100% your question but for geo location ip tracks for web you can use Google Analytics and give you all information you need.

HTML5 Geolocation API to Obtain WiFi AC Information?

I am trying to create an application in HTML5 that attempts to determine a list of Wifi access points in range of the user's device. I've done some research and discovered that Google's geolocation API sends a
"computer’s IP address and a collection of information of [its]
surrounding Wi-Fi access points to their default location service
provider (e.g., Google Location Services..."
I have yet to find, however, any resources that look into if the possibility of obtaining information such as SSID, MAC address, etc for a developer using the API. Is this possible, and if so, could you redirect me to another source or explain how to retrieve them? Even the documentation for the API does not specify how to retrieve the information that Google uses to determine geolocation. Any help is appreciated. Thank you.
Article for above quote
As far as I know, there is no public API to retrieve the SSID, MAC address in HTML5. It is being implemented inside the browser to pass it to the location service provider.
You can only get the information unless you wrote your own native application.

Do Google API keys work with Google Maps web services, e.g. geocoding?

I'm using Google Maps web services to perform server-side (reverse) geocoding.
I've got a browser-side and server-side Google API key from the Google APIs Console, which permits the Google Maps JS API to use higher request quotas, and enables pay-per-use for overages (successfully tested in-browser via JS). But the server-side key doesn't seem to work on web services requests.
For example, this URL works fine:
http://maps.googleapis.com/maps/api/geocode/json?sensor=true&latlng=43.477329,-80.548601
But if you add a "key=..." parameter, as in the other APIs, I get a REQUEST_DENIED status.
Am I doing something wrong, or is this just not supported on the web services APIs (yet)? Will it be supported in the future?
See also
request_denied when i include key=my_api_key
Nope, you're not doing anything wrong.
Unfortunately, enforcing tight limits on the Google Geocoding API, also called "Server-Side Geocoding", is Google's design. If your app needs more than 2,500 Server-Side Geocodes per day, then you'll need to upgrade to their Google Maps API for Business product.
Hold on, it gets worse.
If your app's server IP address is shared with other apps, that 2,500 request daily limit applies to ALL of them. This includes apps that share the same server IP address as you, but don't belong to you! This can be a common situation with any PaaS, like Google App Engine or Heroku. So, even if your app works flawlessly today, there is no guarantee that it's still going to work tomorrow.
In the article, "Geocoding Strategies", Google indicates the solution is to "almost always" use "Client-Side Geocoding" via the Geocoding Service, part of the Google Maps JavaScript API V3. The primary reason is that limits are enforced per user, per session. Requests like this shouldn't run up against quota limits unless you're executing geocode batches on the client (not a typical use case).
One golden nugget from the "Geocoding Strategies" article: Design a page that takes user input, calls the client-side Geocode service method, then passes that information to your server app where it can be processed, and hopefully cached. This is FAR from ideal, but if upgrading to Google Maps API for Business isn't an option, it might be the only way to go.
Good luck!
According to this post, your API key should work as one of the three option for requests over 25,000 loads per day.
https://developers.google.com/maps/faq#usagelimits

Is it possible to get Google Maps Directions using HTTP requests?

Is it possible to use the Google Maps API router just using HTTP? Something like http://maps.google.com?from=blah?to=blah
And have it return some sort of XML or JSON representing the directions?
If you want Google to allow legal access to driving directions via HTTP you might consider voting for the enhancement request: Issue 235. Theoretically, the more people that vote for an enhancement request, the more attention Google give to it.
However, I strongly suspect that there might be contractual issues with the organisations that supply the data. Organisations like TeleAtlas impose restrictions about how Google can use their data. TeleAtlas probably don't want Google to make it legal for people to use their data to create apps for free that directly compete with their own commercial apps and devices.
There is no documented and approved method to access driving directions via an HTTP API request.
This makes it difficult to get driving directions on the server-side, which I assume is your intention.
Not only it is undocumented and difficult to achieve, but it would also violate the restrictions 10.1 and 10.5 of the Google Maps API Terms and Conditions.
However, if you don't mind the challenge, and you believe that rules are there to be broken, you may want to check these articles:
Calculate driving directions using PHP?
Retrieve driving directions from google maps with server-side HTTP calls and show results with static maps for WAP
Actually yes, and they do it themselves
The REST format is like:
http://maps.google.com/maps/nav?output=js&q=from:%20Montreal%20to:%20Toronto&key=apikey
Where q should have the form: "from: x to: y" (url encoded).
Some of the parameters are similar to the HTTP Geocoding service: http://code.google.com/apis/maps/documentation/geocoding/index.html
Mike
As of May, 2010, directions are available via web services:
http://code.google.com/apis/maps/documentation/directions/
Directions are returned in XML or JSON format:
http://maps.google.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
http://maps.google.com/maps/api/directions/xml?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
It's pretty danged easy to use.
Here you can find a list of parameters you can pass to the maps.google.com URL. Maybe you'll be able to get the information you need. I don't know what the returned output contains. At least you are able to define different output types.
I have already used this library with python and it works well, although it's against Google Maps API Terms.
API v3 (made the official version in the last six months), does:
http://code.google.com/apis/maps/documentation/directions/
Also note that most of the competing services (Bing Maps, Yahoo, MapQuest, CloudMade, etc) also support RESTful web services along these lines.
As always with these services, check the Terms & Conditions.
I've never used the API but it is pretty easy to get the structured directions data from a google maps page using JS to access the gmap page's DOM.