Get only wikitext without JSON from Wikipedia API









up vote
0
down vote

favorite












Does the Wikipedia API have some endpoint or parameter to return only the wikitext of a page or a section of a page in the HTTP response body (i.e. without the JSON around it?) In this case it could use HTTP status codes to signal an error. The point would be to simplify parsing (no JSON).










share|improve this question

























    up vote
    0
    down vote

    favorite












    Does the Wikipedia API have some endpoint or parameter to return only the wikitext of a page or a section of a page in the HTTP response body (i.e. without the JSON around it?) In this case it could use HTTP status codes to signal an error. The point would be to simplify parsing (no JSON).










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Does the Wikipedia API have some endpoint or parameter to return only the wikitext of a page or a section of a page in the HTTP response body (i.e. without the JSON around it?) In this case it could use HTTP status codes to signal an error. The point would be to simplify parsing (no JSON).










      share|improve this question













      Does the Wikipedia API have some endpoint or parameter to return only the wikitext of a page or a section of a page in the HTTP response body (i.e. without the JSON around it?) In this case it could use HTTP status codes to signal an error. The point would be to simplify parsing (no JSON).







      wikipedia-api






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 4 at 13:10









      Lassi

      563515




      563515






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Not technically part of the API but it's possible:



          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw
          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw&section=0






          share|improve this answer




















          • Awesome! And the URLs are simpler than those of the advertised API as well :)
            – Lassi
            Nov 12 at 17:43










          • Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
            – Lassi
            Nov 12 at 17:47










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53141175%2fget-only-wikitext-without-json-from-wikipedia-api%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Not technically part of the API but it's possible:



          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw
          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw&section=0






          share|improve this answer




















          • Awesome! And the URLs are simpler than those of the advertised API as well :)
            – Lassi
            Nov 12 at 17:43










          • Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
            – Lassi
            Nov 12 at 17:47














          up vote
          1
          down vote



          accepted










          Not technically part of the API but it's possible:



          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw
          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw&section=0






          share|improve this answer




















          • Awesome! And the URLs are simpler than those of the advertised API as well :)
            – Lassi
            Nov 12 at 17:43










          • Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
            – Lassi
            Nov 12 at 17:47












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Not technically part of the API but it's possible:



          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw
          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw&section=0






          share|improve this answer












          Not technically part of the API but it's possible:



          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw
          https://en.wikipedia.org/wiki/Cape_York_meteorite?action=raw&section=0







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 1:14









          Tgr

          20.4k86297




          20.4k86297











          • Awesome! And the URLs are simpler than those of the advertised API as well :)
            – Lassi
            Nov 12 at 17:43










          • Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
            – Lassi
            Nov 12 at 17:47
















          • Awesome! And the URLs are simpler than those of the advertised API as well :)
            – Lassi
            Nov 12 at 17:43










          • Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
            – Lassi
            Nov 12 at 17:47















          Awesome! And the URLs are simpler than those of the advertised API as well :)
          – Lassi
          Nov 12 at 17:43




          Awesome! And the URLs are simpler than those of the advertised API as well :)
          – Lassi
          Nov 12 at 17:43












          Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
          – Lassi
          Nov 12 at 17:47




          Also properly returns a HTTP 404 error code in case the article is not found: en.wikipedia.org/wiki/No_such_page?action=raw
          – Lassi
          Nov 12 at 17:47

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53141175%2fget-only-wikitext-without-json-from-wikipedia-api%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          天津地下鉄3号線

          How to fill missing numeric if any value in a subset is missing, all other columns with the same subset are missing