Google Api For Language translation Not Work - iphone

Google Api For Language Translation Does Not Work.
i tried
http://ajax.googleapis.com/ajax/services/language/translate?q=hello&v=1.0&langpair=en|fr
TO Convert "hello" From English To French
But It Says:
{"responseData": null, "responseDetails": "Suspected Terms of Service Abuse. Please see http://code.google.com/apis/errors", "responseStatus": 403}
List item
So, how can i translate data?
is there another way to translate via calling another web service.

For me your URL gives the following response:
{"responseData": null, "responseDetails": "Please use Translate v2. See http://code.google.com/apis/language/translate/overview.html", "responseStatus": 403}
And on the URL above:
Only paid version of translator API exist since December 2011.
http://code.google.com/apis/language/translate/overview.html

Related

Bungie API for Destiny2 user: find membershipId or bungie display name by platform nickname

I am supporting an app that gets player game statistics. We have for example playstation or xbox nickname and need to find bungie membershipId.
I look code - we missuse "Destiny2/SearchDestinyPlayer" API, as it requires not playstation nickname (or xbox nickname) but full bungie name including #xxxx (# id)
https://bungie-net.github.io/#Destiny2.SearchDestinyPlayer
Looks like before in Destiny2 appeared cross-save function it was the same nickname and #id was not mandatory.
Could someone suggest another API that accepts platform (xbox or playstation) nickname?
Also maybe suggest forum dedicated to bungie API?
PS: I searched alternative sites, for example on "https://destinytracker.com/" I am able to select platform "Playstation" and enter nickname "T-rex_on_point" - it finds bungie name Brontosaurus881#6169 and also membershipId inside URL. How it does it? What API it uses?
I finally need "membershipId" id, but if I will find full bungie display name - then I am able to find "membershipId" with Destiny2/SearchDestinyPlayer" API mentioned above
There is no "Other API". All applications uses one API which's Bungie's.
I'm assuming you're making the request using # in the URL which's not UTF-8 URL encoded.
You'll need to encode the URL specifically the # which will be encoded to %23. So instead of making the request with this name Brontosaurus881#6169 it should be like this Brontosaurus881%236169.
Also what language are you using? if Python then use urllib.parse.quote("Brontosaurus881#6169").
If not then i suggest you looking up how to encode a URL in x language.
Also if you're using Python, There's a wrapper around the API that already does that for you if you're interested and using Python.

Extracting value from API/Webpage

I'm trying to retrieve the 'estimated value' field displayed on the https://www.poppriceguide.com/ website so it can be displayed in a google sheets automatically.
Example URL: https://www.hobbydb.com/marketplaces/poppriceguide/catalog_items/iron-man-model-39
I've tried using the =IMPORTXML() function as such:
=IMPORTXML(https://www.hobbydb.com/marketplaces/poppriceguide/catalog_items/iron-man-model-39, /*[contains(concat( " ", #class, " " ), concat( " ", "value", " " ))])
with no success, seemingly to be caused because it is retrieved using Javascript.
Doing some research I found poppriceguide is using Hobbydb's API which according to Hobbydb should be available.
https://help.hobbydb.com/support/solutions/articles/36000265069-access-to-the-hobbydb-api
https://help.hobbydb.com/support/solutions/articles/36000263216-adding-estimated-values-and-other-data-to-your-own-site
Going through the network calls I found this API request, however when I do it separately it gives me an authentication failed.
https://www.hobbydb.com/api/price_guide?catalog_item_id=520170
Other API Requests do work however, for example:
https://www.hobbydb.com/api/catalog_items/323645
How would I go about retrieving the value so it can dynamically be displayed in a Google sheets?
The link you shared says
Let us know if you are interested in exploring co-operation and using the API. Please provide us with a good overview of your project.
This is likely to mean that the API requires authentication
It is also possible for the API to have certain endpoints that are free, which is why some seem to work. Yet with no publicly available documentation, there is no way to know which ones.
So unfortunately you will not be able to use Apps Script for this, you could look into some other web scraping software, maybe Puppeteer. Or try and apply for an API key from HobbyDB.

Provide array of URNs to LinkedIn REST API?

I am using the LinkedIn Marketing Development Platform where I am trying to provide a list of company URNs to to the Ad Analytics API. However, when I try to provide a list of company URNs, it fails with status 400.
Analytics Finder endpoint docs
My request:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CAMPAIGN&dateRange.start.day=1&dateRange.start.month=1&dateRange.start.year=2017&timeGranularity=ALL&companies=urn:li:organization:1234,urn:li:organization:5678
Response:
{"message":"Array parameter 'companies' value 'urn:li:organization:1234,urn:li:organization:5678' is invalid. Reason: Deserializing output 'urn:li:organization:1234,urn:li:organization:5678' failed","status":400}
I have also tried URL encoding the URL, and providing the list via the parameter companies[0] as is done in other examples in the docs.
What is the correct way to input arrays to the LinkedIn API?
Edit: Changed accounts to companies
So the Protocol Version actually gave me some useful insight. There are a couple of ways of providing arrays in parameters.
From the docs:
For Restli V1.0 (used by default)
GET GET https://api.linkedin.com/people?ids=1&ids=2&ids=3
For Restli V2.0, which you can use by setting the following header: X-RestLi-Protocol-Version: 2.0.0
Pass parameters in List format.
GET https://api.linkedin.com/v2/people?ids=List(1,2,3,4)
However, I have not managed to get the Analytics Finder API to work with Restli V2.0.
You'll need to provide the list of URL encoded organization URNs to the accounts param. Using your request as an example:
&accounts=List(urn%3Ali%3Aorganization%3A1234,urn%3Ali%3Aorganization%3A5678)

Error in Bing Search API

I am using the new Bing Search API v.5 in my app (javascript).
This is the query: "31 'Jerry Willemse' netherlands 'intercop'"
If I access the Bing Search API from within my app I get zero results.
If I use the test tool available here: https://dev.cognitive.microsoft.com/docs/services/56b43eeccf5ff8098cef3807/operations/56b4447dcf5ff8098cef380d/console
I get several results.
The test tool should precisely mimic the behavior of the API.
This is the URL generated by the API test tool
https://api.cognitive.microsoft.com/bing/v5.0/search?q='jerry willemse' netherlands 'intercop' 31&count=10&offset=0&mkt=en-us&safesearch=Moderate
Can URLs include spaces?
In fact, urls cannot include spaces.
You can replace spaces with '%20' or '+'.
Here are some useful ones:
+   %2B   
space %20 
/   %2F     
?   %3F     
%  %25     
#   %23     
&   %26     
=   %3D
You can also use function encodeURI(URIstring) provided by javascript to do replacing.

Facebook Graph API Gender

Hi I have problem with Facebook Graph API. I'm using it in cordova with this plugin: https://github.com/jeduan/cordova-plugin-facebook4 (I think is not important)
The main problem is value gender. When system language is English I get following value:
gender: "male"
but when my system language is Czech I get following value:
gender: "muž"
and this is problem for me because I expecting for future work "male" or "female"
does anyone now how to figure it out and get always english?
Thanks for any answer
You just have to add the locale to the API call, it would be like this for english:
/me?fields=gender&locale=en_US
Or with the Cordova plugin:
facebookConnectPlugin.api('/me?fields=gender&locale=en_US', ...)
See this for more information about how to use the Graph API.
Written under "Modifying API Requests":
locale
Used if your app needs the ability to retrieve localized content in the language of a particular locale (when available).
So try to set the locale parameter to english.