Get Wikipedia math expressions using MediaWiki API

TigerInALoop

I want to get the content of <math> tags in the API response MediaWiki.

I've tried to use this query: https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=xml&titles=delta-v

And I'm getting valid xml file, but in place of enter image description here

I'm getting:

<dl><dd></dd></dl>

And what I want is:

<math>\Delta{v} = \int_{t_0}^{t_1} {\frac {|T|} {m}}\, dt</math>

Which is available via "Edit" button here: http://en.wikipedia.org/w/index.php?title=Delta-v&action=edit

is this somehow available via API?

leo

You need to query for the whole page source, using MediaWiki's native API function:

    https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvlimit=1&rvprop=content&format=xml&titles=delta-v

That will give you exactly the same thing as you see when editing the page.

The prop=extracts query is implemented by the extension TextExtracts, and does not always work with code content generated by other extensions (such as Math). It can probably be considered a bug in TextExtracts, but given the complexity of page rendering in MediaWiki, and the number of ways in which various extensions add to the content, it will probably never catch everything.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Wikipedia Mediawiki API get URL in query

From Dev

Using the Mediawiki API to return a Wikipedia page URL

From Dev

How to get all url's ( not just titles ) in a wikipedia article using mediawiki api?

From Dev

How to get all Wikipedia article titles with MediaWiki API?

From Dev

How to get all Wikipedia article titles with MediaWiki API?

From Dev

Get first link of wikipedia article using Wikipedia api

From Dev

How to get birth location using Wikipedia API

From Dev

Is there any possibility to get the plain (MediaWiki-markup) source instead of HTML source of Wikipedia-pages via API?

From Dev

Searching Wikipedia using API

From Dev

Wikipedia / MediaWiki API: Find if an article is about a person, organization or location

From Dev

Why does this Wikipedia mediawiki api request not return categories to all links?

From Dev

Wikipedia / MediaWiki API: Find if an article is about a person, organization or location

From Dev

Solving math expressions using java

From Dev

Call MediaWiki script from Wikipedia

From Dev

how to get attributes using PHP SimpleXML (in mediawiki-api-xml output)

From Dev

Mediawiki API Sandbox - get all translation alternatives

From Dev

Can't get randomized JSON object attributes using Wikipedia API call

From Dev

Wikipedia search API get redirect pageID

From Dev

Wikipedia API - get random page(s)

From Dev

Wikipedia API - get full information from infobox

From Dev

How to get Wikidata ID for an Wikipedia article by API?

From Dev

Get artist discography and tracklists via Wikipedia API

From Dev

How to get localizable links with wikipedia API

From Dev

Using MediaWiki api to search for events on a specific date

From Dev

Getting talk page title using mediawiki API

From Dev

Using MediaWiki api to search for events on a specific date

From Dev

Using fetch library for Wikipedia API - Javascript

From Dev

Using WebGL API to do math

From Dev

MediaWiki Query and/or WikidataQuery to find Wikipedia article

Related Related

  1. 1

    Wikipedia Mediawiki API get URL in query

  2. 2

    Using the Mediawiki API to return a Wikipedia page URL

  3. 3

    How to get all url's ( not just titles ) in a wikipedia article using mediawiki api?

  4. 4

    How to get all Wikipedia article titles with MediaWiki API?

  5. 5

    How to get all Wikipedia article titles with MediaWiki API?

  6. 6

    Get first link of wikipedia article using Wikipedia api

  7. 7

    How to get birth location using Wikipedia API

  8. 8

    Is there any possibility to get the plain (MediaWiki-markup) source instead of HTML source of Wikipedia-pages via API?

  9. 9

    Searching Wikipedia using API

  10. 10

    Wikipedia / MediaWiki API: Find if an article is about a person, organization or location

  11. 11

    Why does this Wikipedia mediawiki api request not return categories to all links?

  12. 12

    Wikipedia / MediaWiki API: Find if an article is about a person, organization or location

  13. 13

    Solving math expressions using java

  14. 14

    Call MediaWiki script from Wikipedia

  15. 15

    how to get attributes using PHP SimpleXML (in mediawiki-api-xml output)

  16. 16

    Mediawiki API Sandbox - get all translation alternatives

  17. 17

    Can't get randomized JSON object attributes using Wikipedia API call

  18. 18

    Wikipedia search API get redirect pageID

  19. 19

    Wikipedia API - get random page(s)

  20. 20

    Wikipedia API - get full information from infobox

  21. 21

    How to get Wikidata ID for an Wikipedia article by API?

  22. 22

    Get artist discography and tracklists via Wikipedia API

  23. 23

    How to get localizable links with wikipedia API

  24. 24

    Using MediaWiki api to search for events on a specific date

  25. 25

    Getting talk page title using mediawiki API

  26. 26

    Using MediaWiki api to search for events on a specific date

  27. 27

    Using fetch library for Wikipedia API - Javascript

  28. 28

    Using WebGL API to do math

  29. 29

    MediaWiki Query and/or WikidataQuery to find Wikipedia article

HotTag

Archive