title: How to extract a random post from a random subreddit? (Reddit API)
body: <p>I'm trying to extract a random posting from a <code>random</code> <code>subreddit</code> in one api call, and I can't figure out how. Is this possible, and if not, how would I accomplish this with multiple api calls and minimum overhead?</p>
  
  <p>The following request returns a random <code>subreddit</code>.</p>
  
  <pre><code>http://www.reddit.com/r/random.json
  </code></pre>
  
  <p>Contrary to what one might expect from the <code>json</code> extension, the data returned from the call is a complete webpage with markup, which is not what I want. The same request with an actual <code>subreddit</code> is shown below.</p>
  
  <pre><code>http://www.reddit.com/r/apple.json
  </code></pre>
  
  <p>This request yields the apple <code>subreddit</code> in <code>json</code> format. In order to retrieve 5 postings from the apple <code>subreddit</code> the following api call can be made.</p>
  
  <pre><code>http://www.reddit.com/r/apple/comments.json?limit=5
  </code></pre>
  
  <p>I figured I could apply the above api call to the <code>random</code> url - as shown below.</p>
  
  <pre><code>http://www.reddit.com/r/random/comments.json?limit=5
  </code></pre>
  
  <p>This works as expected, yet the result is not in <code>json</code> format. It is a complete webpage with markup.</p>
  
  <p>Links: <a href="http://www.reddit.com/dev/api" rel="nofollow">The reddit API</a></p>