1

I am getting some #REDIRECT in the snippet but i actually want the query to give me the redirected results, is there a way to do that without parsing what the redirect is and initialed another query? I tried setting the parameter redirects but it did nothing.

Example: https://en.wikipedia.org/w/api.php?format=json&action=query&list=search&srsearch=Unity3D&utf8&srlimit=10&srwhat=nearmatch&redirects

i would like it to return something like this: https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Unity%20(game%20engine)&srlimit=1

4

1 回答 1

2

您可以做的是search用作生成器。如果你这样做,redirects将工作:

https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrsearch=Unity3D&utf8&gsrlimit=10&gsrwhat=nearmatch&redirects

于 2015-10-03T12:24:52.893 回答