I tried to get the description of the movie "Your Highness" from the Wikipedia API but it gives me nothing.
http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=your%20highness&prop=revisions&rvprop=content
When I google "Your Highness" wikipedia shows up as the third result, that's the page that I want the API to give me.
Also I just want the text of the description of the movie, no wiki-syntax mixed in or anything.
I was wrong before about the problem being a space - it looks like it was just capitalization. If we just change your URL to use Your%20Highness instead of your%20highness it works:
http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=Your%20Highness&prop=revisions&rvprop=content
EDIT: While not all titles are title-cased (such as "The Name of the Rose") if you use the &redirects query parameter, it sometimes helps - it certainly helps in "the name of the rose" but not for "your highness" for some reason. Wouldn't like to say why, but it's probably worth more investigation...
Related
I want to get minimal information of a Wikipedia page using MediaWiki API like DuckDuckGo. For example for Steve Carell: https://duckduckgo.com/?q=steve+carell&t=hp&ia=news&iax=about
How can I get this information with a Wikipedia url (eg https://en.wikipedia.org/wiki/Steve_Carell) in HTML format?
You can use the MediaWiki API for that. There's an extension, TextExtracts, which is exactly for that (and it is installed on Wikipedia).
In your case, e.g.:
https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exsentences=1&titles=Steve%20Carell
will return something like:
<p class=\"mw-empty-elt\">\n</p>\n\n<p class=\"mw-empty-elt\">\n \n</p>\n<p><b>Steven John Carell</b> (<span></span>; born August 16, 1962) is an American actor, comedian, producer, writer and director.</p>
You can customize how many sentences (or characters) the API returns, as well, please consult the API documentation for that.
There's also the way to retrieve the short description, which is saved at Wikidata (and visible in the mobile view of Wikipedia). This call would be:
https://en.wikipedia.org/w/api.php?action=query&prop=pageprops&titles=Steve_Carell
This returns the following property in the pageprops of the page:
"wikibase-shortdesc": "American actor"
This may fit better depending on your use case.
You can even get both of the results with a single, combined, request:
https://en.wikipedia.org/w/api.php?action=query&prop=extracts|pageprops&exsentences=1&titles=Steve_Carell
I'm testing our Loqate's Adress Verification
https://www.loqate.com/resources/support/apis/Capture/Interactive/Retrieve/1/
The API is asking for a Key and Id as part of the required parameters, I have the Key, but for the Id it says in the description that it's a "Find Method" but I don't know where or which they are.
What are valid Id's I can put in there?
Anyone here have any experience with this?
Thanks.
The function, you mentioned, needs another function to unfold their whole functionality.
First of all you need to get some suggestion made by a search of a user e.g.
https://www.loqate.com/resources/support/apis/Capture/Interactive/Find/1.1/
This function will give you back suggestions. If the type is "address" you can use the given id of the respond to get the whole data of an address you found.
Hope this helps!
Starting a request like that:
https://en.wikipedia.org/w/api.php?action=query&format=json&titles=Title&prop=links&pllimit=500
provides me a list of links (that the page contains) where every link consists of the title and the ns (namespace)
Is there a way to also get the PageID together with title & ns? (the less work it is for the sever the better of course)
You need to use generator parameter. Here is an example for Cobra Wikipedia page.
https://en.wikipedia.org/w/api.php?action=query&generator=links&titles=Cobra&prop=info&gpllimit=500
When you type hackisition on Google, it returns the following url as first result:
https://www.hackisition.com/en/
// instead of
https://www.hackisition.com/
I'd like to replace that link by the real homepage. How can I do that? Is there a way to specifically ask Google to show this homepage?
I am getting "https://www.hackisition.com/" as first result for "hackisition". I'm not sure why you're getting such result. Try to clear cookies and turn off VPN/Proxy if you're using one.
We are getting result as you said , so I suggest to clear cache
Maybe that is because of User location.
That mean countries preferred English on search would be able to see /en
and other countries that not prefer English will see the non /en result.
Search your website on
Google.ae
Google.DK
you'll see https://www.hackisition.com in result not https://www.hackisition.com/en.
But if you search in Google.com, Google.eu you'll see the result https://www.hackisition.com/en
Hope this would be the solution of your problem.
I need to get Api Response in Hindi and Korean. I have passed languge parameter with(hi for hindi) and checking its response by simulator but it's result is always in English.
Here is Url that was made by me for getting Search places result in Hindi
https://maps.googleapis.com/maps/api/place/search/json?location=28.580000,77.330000&sensor=true&key=AIzaSyAnAS2zrUGCxU5zp_JvuCrBWLwndv7rElI&name=BURGER&rankby=distance&language=hi
Please tell me if anybody has idea bout my question.
See the description of the language-parameter:
The language code, indicating in which language the results should be returned, if possible
There is no guarantee that the results will be in the desired language.
When there is no translation for the desired language/particular place-detail available, you will not get it.
So your attempt is correct, but you may not get better results.
When you inspect the response you'll see that you get results in hindi(where available) e.g. for Sangam Fry Burger -> संगम फ्राय बर्गर