Google Translate API and word correction - api

translate.google.com corrects word and shows some additional info about it
But Google Translate API returns only translation:
Also, it doesn't translating incorrect words.
Q. Can I somehow translate incorrect words with API?

No, there's no mechanism to do this built into the Google Translate API as of right now.
You'd need to do this correction on your end prior to requesting a translation.

Related

Bing Spell Checker is not working as expected

https://api.bing.microsoft.com/v7.0/spellcheck?text=mus&mkt=en-GB&mode=spell
Using the above URL and given my supplied API key within the request headers - I am getting no results back from the Bing Spell Checker API using PostMan or from Refit in C#(Xamarin Forms).
For 'mus' I'm expecting 'must', for 'tst' I'm expecting 'test' but, neither seem to work.
I've set the mode to 'spell' which should be the case however, even in 'proof' mode it doesn't return any results.
Please can somebody let me know why?
Thanks
The documentation explains:
Bing Spell Check API lets you perform contextual grammar and spell checking on a text string. While most spell-checkers rely on dictionary-based rule sets, the Bing spell-checker leverages machine learning and statistical machine translation to provide accurate and contextual corrections.
I assume that passing single words in most cases won’t provide enough information for this approach.
Try passing phrases that put your words in some reasonable context like mst have or quality tst.
For single word suggestions you can try a dictionary based service or software package.

How to search and filter tweetts using Twitter API?

I am exploring how to search and filter tweets using the Twitter API version 2 which as of this writing has been newly released. The documentation for this particular endpoint is available here.
I tried successfully searching for the following query:
https://api.twitter.com/2/tweets/search/recent?query=puppy
As I needed to be more specific, I checked out v1.1 docs for rules and filtering and tried to look for tweets containing puppy images (filter:image) and no retweets (-filter:retweets) but I could not get the query in v2 (preferably) or v1.1 working with postman even though I tried percent-encoding for the special characters.
It is also not clear to me from the documentation (though mentioned in the docs) how to specify a certain language like English (lang=english) and a certain distance in the query "37.781157,-122.398720,1mi"
Does somebody know how to pass it into the query?
For language filter you can refer the post
https://community.postman.com/t/define-the-language-of-tweets/20643
But I am not sure about the image filter. But in recent times a developer sean.keegan from Postman is talking more about twitter API's in Postman. Please do check out https://community.postman.com/search?q=twitter and https://www.youtube.com/watch?v=ySbLo13Fk-c
I hope these will be helpful for you!!

How to use exactTerms and excludeTerms with Google Custom Search JSON API

I've been working with Google Custom Search API and faced some inconveniences I hope you can help me with.
Google Custom Search API offers as a parameter in its call the possibility to search by an exact text as well as exclude it from results: exactTerms and excludeTerms. However, the q parameter is mandatory and cannot be ignored, so if I want to search only by an specific text I just can't.
So how can I do a query using JSON API that contains specifically the text I want? Does the q parameter work as the search form in Google?
If I want results including 'foo', should I do this:
service.cse().list(cx=const.SEARCH_ENGINE_KEY, q='"foo"').execute()
or this?:
service.cse().list(cx=const.SEARCH_ENGINE_KEY, q=None, exactTerms='foo').execute()
Thank you in advance for your time.
Due to the success on the answers (hehe) I'm posting my own conclusions. Please, if you've any facts regarding the original question, please post it.
I've been testing with some calls to Google CSE API and looks like you can pass to q parameter the same query you'd do in Google's main page textfield. So (at least for my needs), you don't need exactTerms and excludeTerms to get what I was trying to achieve.
Anyway, as I said before, if you know how to work with these parameters I'm sure everybody will thank you.

YouTube API v3 language filter

Is there any option to filter the results by language in YouTube v3 search API?
In v2 there is parameter like lr which i can set to specified language.
There is no language filtering in Youtube API v3. The only thing you can make with Youtube API v3 is you can use the region code such that
GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=is&regionCode=YOUR_REGION_CODE&key={YOUR_API_KEY}
However, it most probably will not do what you want. Therefore, you should use some external language filtering libraries
relevanceLanguage string
The relevanceLanguage parameter instructs the API to return search
results that are most relevant to the specified language. The
parameter value is typically an ISO 639-1 two-letter language code.
However, you should use the values zh-Hans for simplified Chinese and
zh-Hant for traditional Chinese. Please note that results in other
languages will still be returned if they are highly relevant to the
search query term.
see also YouTube Data API

Twitter Queries

I'm trying to write a URL for Twitter's Search API.
The page says you can search for love or hate:
https://dev.twitter.com/docs/using-search
love OR hate containing either "love" or "hate" (or both)
But I'm not seeing a way to do this.
It should be fairly simple:
http://search.twitter.com/search.json?q=%40twitterapi
is an example of a URL that searches for twitterapi. But how would I search for two terms? What's the operand for OR in this context?
Nevermind, it appears that %20OR%20 works in this context.