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

118
Views
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 answers
Answer question

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 Report

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 Report

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 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!