Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda