I tested your code and looks like the headers are unnecessary
CopygetData();
async function getData() {
const api_url = "https://api.github.com/users/alisirri/repos";
const response = await fetch(api_url);
console.log(await response.json());
}
Answer from yolisses on Stack OverflowGitHub
github.com › json-api › json-api
GitHub - json-api/json-api: A specification for building JSON APIs · GitHub
Documentation for the application/vnd.api+json media type, a specification for APIs that use JSON. This repository is the source code for http://jsonapi.org. ... This standard is currently under development.
Starred by 7.7K users
Forked by 920 users
Languages CSS 43.6% | JavaScript 37.8% | HTML 7.7% | Sass 3.4% | Python 2.9% | Makefile 2.0%
Videos
02:39
How to Host JSON File/API on GitHub| GitHub Tutorial 2025 - YouTube
Deploy Json Api on Github | Host Json Api for free on Github - YouTube
07:22
Exploring the GitHub REST API in 7' - YouTube
How to Host API on GitHub || How to Host JSON API on Server
04:10
GitHub API Tutorial | 2023 - YouTube
11:17
Using GitHub for a RESTful JSON API (Ecommerce #26) - YouTube
GitHub
github.com › typicode › json-server
GitHub - typicode/json-server: Get a full fake REST API with zero coding in less than 30 seconds (seriously) · GitHub
Get a full fake REST API with zero coding in less than 30 seconds (seriously) - typicode/json-server
Starred by 75.6K users
Forked by 7.3K users
Languages JavaScript 91.7% | HTML 8.3%
GitHub
github.com › apis-json › api-json
GitHub - apis-json/api-json: APIS.json an API discovery format · GitHub
APIS.json an API discovery format. Contribute to apis-json/api-json development by creating an account on GitHub.
Starred by 119 users
Forked by 25 users
Top answer 1 of 2
1
I tested your code and looks like the headers are unnecessary
CopygetData();
async function getData() {
const api_url = "https://api.github.com/users/alisirri/repos";
const response = await fetch(api_url);
console.log(await response.json());
}
2 of 2
1
Replace everything in the js file with this:
Copyconst api_repo_url = "https://api.github.com/users/alisirri/repos";
fetch(api_repo_url, {
headers: {
authorization: "TOKEN",
},
})
.then((response) => response.json())
.then((data) => {
console.log(data);
});
No need for async either as .then() takes care of that
GitHub
github.com › neomerx › json-api
GitHub - neomerx/json-api: Framework agnostic JSON API (jsonapi.org) implementation
It supports document structure, errors, data fetching as described in JSON API Format and covers parsing and checking HTTP request parameters and headers. For instance it helps to correctly respond with Unsupported Media Type (HTTP code 415) and Not Acceptable (HTTP code 406) to invalid requests.
Starred by 738 users
Forked by 67 users
Languages PHP 99.9% | Dockerfile 0.1% | PHP 99.9% | Dockerfile 0.1%
GitHub
github.com › json-api › json-api › issues
json-api/json-api
A specification for building JSON APIs. Contribute to json-api/json-api development by creating an account on GitHub.
Author json-api
GitHub
github.com › ethanresnick › json-api-example
GitHub - ethanresnick/json-api-example: An example API created with my JSON-API library (http://github.com/ethanresnick/json-api) · GitHub
Starred by 31 users
Forked by 15 users
Languages JavaScript
GitHub
github.com › json-api-dotnet › JsonApiDotNetCore
GitHub - json-api-dotnet/JsonApiDotNetCore: A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core. · GitHub
A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core. - json-api-dotnet/JsonApiDotNetCore
Starred by 714 users
Forked by 162 users
Languages C#
GitHub
github.com › public-apis › public-apis
GitHub - public-apis/public-apis: A collective list of free APIs · GitHub
Starred by 409K users
Forked by 44.1K users
Languages Python 96.8% | Shell 3.2%
GitHub
github.com › api-platform › json-api
GitHub - api-platform/json-api: [READ ONLY] API Platform JSON:API component
[READ ONLY] API Platform JSON:API component. Contribute to api-platform/json-api development by creating an account on GitHub.
Author api-platform
GitHub
github.com › timacdonald › json-api
GitHub - timacdonald/json-api: A lightweight API resource for Laravel that helps you adhere to the JSON:API standard. Supports sparse fieldsets, compound documents, and more. · GitHub
A lightweight API resource for Laravel that helps you adhere to the JSON:API standard. Supports sparse fieldsets, compound documents, and more. - timacdonald/json-api
Starred by 637 users
Forked by 49 users
Languages PHP
GitHub
github.com › mts-ai › FastAPI-JSONAPI
GitHub - mts-ai/FastAPI-JSONAPI: JSON:API for FastAPI · GitHub
FastAPI-JSONAPI is a FastAPI extension for building REST APIs. Implementation of a strong specification JSONAPI 1.0.
Starred by 140 users
Forked by 14 users
Languages Python
