I'm using Marvel's API to build a project where the user sees all the characters that exist on the API.
https://developer.marvel.com/documentation/generalinfo
I'm having some problems with getting all the characters. Marvel's API only lets you get 100 characters max. I know that you can add an attribute to the link's request (offset) to show the characters that come after the first 100 (again, the offset limit is 100). I believe that I can make multiple requests and in each request, increment the offset value, so that all characters show up. The problem is that I don't know how to do it.
let apiKey = process.env.REACT_APP_MARVEL_API_KEY;
let privateKey = process.env.REACT_APP_MARVEL_API_HASH;
let ts = Date.now().toString();
let hash = getHash(ts, privateKey, apiKey);
const URL = `https://gateway.marvel.com/v1/public/characters?ts=${ts}&apikey=${apiKey}&hash=${hash}&limit=100`;
return fetch(URL)
.then((response) => response.json())
.catch((error) => console.log("ERROR : ", error));
My last problem is:
I would like for a visitor in my project to be able to change a character's information (name, image, description, etc), but Marvel's API doesn't allow POST requests. Is there a way to do this?
Thanks in advance for the help.