Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
how to evaluate json response from meme api in html/javascript?

I want to implement this API into my website so I can get random memes from reddit.

The API was made by D3vd on github (https://www.github.com/D3vd/Meme_API)

The response I get from https://meme-api.herokuapp.com/gimme/memes (the api) looks something like this:

{
    "postLink": "https://redd.it/sg8j7b",
    "subreddit": "memes",
    "title": "No you respect the nature now!",
    "url": "https://i.redd.it/nk9eiy1nnte81.jpg",
    "nsfw": false,
    "spoiler": false,
    "author": "Abdul_Sbeei",
    "ups": 423,
    "preview": ["https://preview.redd.it/nk9eiy1nnte81.jpg?width=108\u0026crop=smart\u0026auto=webp\u0026s=253fc41547e5acc1ee3efcc0a4644e8d52d67181", "https://preview.redd.it/nk9eiy1nnte81.jpg?width=216\u0026crop=smart\u0026auto=webp\u0026s=6050660429dd3a4ae6699a0f42294c04fc1fae02", "https://preview.redd.it/nk9eiy1nnte81.jpg?width=320\u0026crop=smart\u0026auto=webp\u0026s=07ff549bbd76d2f25f509cece0149e7939427edd", "https://preview.redd.it/nk9eiy1nnte81.jpg?width=640\u0026crop=smart\u0026auto=webp\u0026s=baa9e058ba9722515aefa9ab28bb95235d0e151b"]
}

How do I get only the image link ("url") with javascript, so that I can display it on my website?

thx in advance

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Some very basic ajax code using fetch should suffice:

fetch('https://meme-api.herokuapp.com/gimme/memes')
  .then(r=>r.json())
  .then(json=>{
    console.log( json.url )
  })

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!