Site
Home / Forum / General Discussion / api key doesn't work

api key doesn't work


Posted: 23 Feb 2024 20:59
kontaa5
Posts: 4
Joined: 2024-02-23

my private key doesn't work I just copy paste it into my code

const picture1 = document.getElementById("bild");
const artistName = "coldplay";
const apiKey = "--";
const url = `https://www.theaudiodb.com/api/v1/json/${apiKey}/search.php?s=${artistName}`;

fetch(url)
.then((response) => response.json())
.then((data) => {
const artistDetails = data.artists[0];
console.log(data);
console.log(`Name: ${artistDetails.strArtist}`);
console.log(`Biografie: ${artistDetails.strBiographyEN}`);
console.log(`Bild: ${artistDetails.strArtistThumb}`);

// Setze das Bild nach dem Laden der Daten
picture1.src = artistDetails.strArtistThumb;
})
.catch((error) => console.error("Fehler beim Abrufen der Daten:", error));

it only works when i use 2 as key and only for coldplay



Posted: 23 Feb 2024 21:34
zag
Posts: 242
Joined: 2020-07-14

Can you test it in a web browser? I should be easily testable.

Are you sure you have the correct sites API key? As patreon has different levels.

Feel free to email [email protected] for direct support.

Posted: 25 Feb 2024 18:09
kontaa5
Posts: 4
Joined: 2024-02-23

1) if i open the website it shows: Server Error

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

2) yeah i just used the key which shows on my profile

Posted: 27 Feb 2024 08:07
kontaa5
Posts: 4
Joined: 2024-02-23

1) if i open the website it shows: Server Error

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

2) yeah i just used the key which shows on my profile

Posted: 28 Feb 2024 09:44
zag
Posts: 242
Joined: 2020-07-14

1) if i open the website it shows: Server Error

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

2) yeah i just used the key which shows on my profile


Sorry i'm confused are you talking about the personal API key in your profile? Or a paid Patreon key?

Posted: 01 Mar 2024 09:30
kontaa5
Posts: 4
Joined: 2024-02-23

about the profile not the paid one

Posted: 20 Mar 2024 14:00
zag
Posts: 242
Joined: 2020-07-14

about the profile not the paid one

Thats only needed for song submission via the API. You don't need that to use the examples.


Showing 0 to 7 (Total: 7)