Quizlet API not available

Viewed 5142

I’m not sure if this is the right place to ask this but I’m trying to use the Quizlet API for a personal project I have but I can’t seem to find where to access the Quizlet API. It seems like there are a few pages on Quizlet about their API but all of them are now gone giving “The page you’re looking for is no longer available error”.

I’m just wondering if anyone knows how I could get the API key (I am relatively new to working with API’S).

2 Answers

Seems that API is hosted at a different URL and may be working at this time. Here's a snippet that came up on google search and seems to be active.

https://www.thiscodeworks.com/get-quizlet-flashcards-via-api/61bbc4382e046e00150bd05b

async function quizlet(id){
    let res = await fetch(`https://quizlet.com/webapi/3.4/studiable-item-documents?filters%5BstudiableContainerId%5D=${id}&filters%5BstudiableContainerType%5D=1&perPage=5&page=1`).then(res => res.json())
    let currentLength = 5;
    let token = res.responses[0].paging.token
    let terms = res.responses[0].models.studiableItem;
    let page = 2;
    console.log({token, terms})
    while (currentLength >= 5){
        let res = await fetch(`https://quizlet.com/webapi/3.4/studiable-item-documents?filters%5BstudiableContainerId%5D=${id}&filters%5BstudiableContainerType%5D=1&perPage=5&page=${page++}&pagingToken=${token}`).then(res => res.json());
        terms.push(...res.responses[0].models.studiableItem);
        currentLength = res.responses[0].models.studiableItem.length;
        token = res.responses[0].paging.token;
    }
    return terms;
}

Related