how to list github repositories within an account that has a given topic

Asked

Viewed 458 times

1

My problem is the following is consuming the github api via javascript fetch, and I want to search inside my repositories, the ones that have a certain topic like "Javacript" or "Programming" the problem is that I haven’t found a way to do this using the git api.

That’s all I’ve got so far.

  async function start()
    {
        const api = async () => {
            const response = await fetch('https://api.github.com/users/LucasFernandoWeb/repos');
            const data = await response.json();

            return data;
        }

        const api_data = await api();

        console.log(api_data);

    }

    // Carrega os cards
    start();

1 answer

2


You can use the Search API, using the parameter q to formulate darlings more advanced.

For example, the following endpoint will return all repositories in the Typescript language to the lffg user:

https://api.github.com/search/repositories?q=user%3Alffg%20language%3ATypeScript

You can use the search tool Github to generate queries that you can use in the parameter q. To documentation also gives you more details on each option.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.