mariocatch
mariocatch

Reputation: 8703

How to use special characters in Wikipedia API?

If you query the wikipedia api for c# with a url such as:

https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=jsonfm&titles=c%23

The response removes the %23 / # and turns it into just C, and displays results for C itself.

The response has this node in the json:

"normalized": [
    {
        "from": "c#",
        "to": "C"
    }

How do you stop the normalization of special characters with the MediaWiki API?

Upvotes: 3

Views: 406

Answers (1)

DavidG
DavidG

Reputation: 118957

You can't stop the normalisation of your search queries as Wikipedia prohibits certain characters from article titles.

From the Wikipedia docs:

Due to clashes with wiki markup and HTML syntax, the following characters are NOT allowed to be part of page titles (nor are they supported by DISPLAYTITLE):

# < > [ ] | { }

Upvotes: 2

Related Questions