Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

402
Vistas
Fetch number of repositories using Github Api

I need to fetch the number of public repositories of a user using the Github API. I know that we can get a list of repos using /users/{username}/repos. This query returns a list of repositories. What I want is just the total number of repositories not the entire list. If I try to count the repositories using /users/{username}/repos it works fine for the users that have smaller number of repositories but for users that have a large number of repositories , the API call takes too much time. Is there any way by which I can get just the number of repos and not the entire list?

almost 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Instead of getting the list of repositories, you can get the user object and look at the public_repos field; for example, using the GitHub CLI:

$ gh api users/bewuethr | jq '.public_repos'
21
almost 4 years ago · Santiago Trujillo Denunciar

0

The total_count field on the first response represents the total count of repositories matching, the response has your answer already.

almost 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda