3

I am looking for an API method that gets the text from posts, using the post ID or URL (not saying it has to be one way or another) but cannot find one.

Does Stack Exchange have one?

5

You can get either the HTML or the markdown of a post using the /posts/{ids} route. But you must specify a custom filter.

For example:
        /2.2/posts/301850?site=meta&filter=!LH22Vfx-WtNBnMCP-eADaa

-- which currently yields:

{
  "items": [ {
      "score": 0,
      "last_activity_date": 1507588384,
      "post_type": "question",
      "post_id": 301850,
      "title": "API for getting text off of posts?",
      "link": "https://meta.stackexchange.com/q/301850",
      "body": "<p>I am looking for an api that gets the text from posts from the post ID or URL (not saying it has to be one way or another) but cannot find one. Does stackexchange have one?</p>\n"
    }
  ]
  ...
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .