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

123
Vistas
how to access data from simple link with api key through http request

I have this simple link https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key

It works fine and give me this

{
  "kind": "blogger#blog",
  "id": "##############",
  "name": "blog-blogger",
  "description": "",
  "published": "2022-02-08T08:38:50-08:00",
  "updated": "2022-02-22T16:52:43-08:00",
  "url": "http://original-1-1.blogspot.com/",
  "selfLink":
  "posts": {
    "totalItems": 1
  },
  "pages": {
    "totalItems": 0
  },
  "locale": {
    "language": "en",
    "country": "?",
    "variant": ""
  }
}

now how i fetch above data using javascript

like

l = fetch(https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key);
q = l.json();
console.log(q.kind);
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

I am working on something similar this is the code I am using.

var request = new XMLHttpRequest()

// Open a new connection, using the GET request on the URL endpoint
request.open('GET', `https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key`, true)

request.onload = function () {
  // Begin accessing JSON data here
  var data = JSON.parse(this.response)
  console.log(data) 
}

Another option is using fetch like you suggested

function getData() {
  const response = await fetch('https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key')
  const data = await response.json()
}

This is the website I got my information from: https://www.taniarascia.com/how-to-connect-to-an-api-with-javascript/

Hope this answers your question!

mrt

about 4 years ago · Juan Pablo Isaza Denunciar

0

This will get you kind

const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
    let responseJSON = JSON.parse(this.responseText);
        console.log(responseJSON.kind);
}
xhttp.open("GET", "https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key", true);
xhttp.send();
about 4 years ago · Juan Pablo Isaza Denunciar

0

// declare a variable to hold your API url like this const url = " https://www.googleapis.com/blogger/v3/blogs/my-ID?key=Api_key"

 // the spelling of your fetch is incorrect. You can use this

fetch(url) .then(response => response.json()) .then(data => console.log(data));

// this should work

// Using your API key Ensure you pass your API key into the REST API call as a query parameter by replacing API_KEY with your API key,

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