{"id":21421423,"url":"https://github.com/percival33/github-api","last_synced_at":"2026-05-18T22:10:54.578Z","repository":{"id":107184941,"uuid":"484403244","full_name":"Percival33/github-api","owner":"Percival33","description":"API retrieving specific data from GithubAPI","archived":false,"fork":false,"pushed_at":"2022-07-14T16:15:29.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T06:44:58.425Z","etag":null,"topics":["api","fastapi","github-api","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Percival33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-22T11:10:22.000Z","updated_at":"2022-08-05T18:41:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"16f8e45d-b60f-4d2b-910a-ceaf67f72c8d","html_url":"https://github.com/Percival33/github-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Fgithub-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Fgithub-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Fgithub-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Fgithub-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percival33","download_url":"https://codeload.github.com/Percival33/github-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926072,"owners_count":20369910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","fastapi","github-api","python3"],"created_at":"2024-11-22T20:34:13.672Z","updated_at":"2026-05-18T22:10:54.536Z","avatar_url":"https://github.com/Percival33.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github API\n\n## About\n\n\u003e *This is a former recruitment task for devops intern position.*\n\nTask was to create API which returns specific data about GitHub user using [GitHub REST API](https://docs.github.com/en/rest).\nI've used [FastAPI](https://fastapi.tiangolo.com/) to create this project. I assumed this API will be only used on local machine, so every request made is authorized with Github credentials (if present).\n\n## Installation\n\n1. You need to have [python3](https://wiki.python.org/moin/BeginnersGuide/Download) and [pip](https://pip.pypa.io/en/stable/installation/#get-pip-py) installed on your machine. Firstly, clone the repo.\n\n2. Change directory to folder with code. Then create new virtual environment `env` and activate it. If you don't have this package use this [link](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) to install it.\n\n    ```bash\n     python3 -m venv env\n     source env/bin/activate\n    ```\n\n    Now you should see (env) next to prompt symbol (usually `$` sign for normal user).\n\n3. Install dependencies and you're ready to go!\n\n    ```bash\n      pip install -r requirements.txt\n    ```\n\n4. Start your server locally.\n\n    ```bash\n      uvicorn api.main:app\n    ```\n\nServer is available at [127.0.0.1:8000](http://127.0.0.1:8000)!\n\nIf everything goes correctly after navigating `localhost:8000` , this is what you should see on screen to make sure everything has been setup correctly.\n\n```json\n{\n  \"response\": \"It works!\",\n  \"meta\": {\n    \"limit\": 0,\n    \"remaining\": 0,\n    \"reset\": 0,\n    \"used\": 0\n  }\n}\n```\n\nAfter using API, turn off `virtualenv` using:\n\n```bash\ndeactivate\n```\n\n## Usage\n\nTo avoid rate limit for unauthorized user from GitHub API, authenticate by creating `credentials.json`. See [creating credentials](#github-api-authorization).\n\n1. One option is to go to [/docs](http://127.0.0.1:8000/docs) and use Swagger UI to use API\n\n2. Other one is to make requests to endpoints in your favourite way\n\n## API Reference\n\nEvery correct endpoint returns JSON response structured like this:\n\n```json\n{\n  \"response\": {},\n  \"meta\": {\n    \"limit\": \"[int]\",\n    \"remaining\": \"[int]\",\n    \"reset\": \"[UTC epoch time in seconds]\",\n    \"used\": \"[int]\"\n  }\n}\n```\n\nWhile endpoints which do not make request to GitHub API, holds zeros in meta fields.\n\n| Status code | Description                                            |\n| :---------: | :----------------------------------------------------- |\n|    `401`    | Returned when no credentials or invalid are passed     |\n|    `403`    | Returned when Github API rate limit is hit             |\n|    `404`    | Returned when no data is found                         |\n|    `500`    | Returned when this API or Github API are not available |\n|    `200`    | Returned in all other situations                       |\n\nTo take a look on full documentation about API, you can get it at [/docs](http://127.0.0.1:8000/docs)\n\n## GitHub API authorization\n\nTo increase your rate limit to 5000 requests per hour, authentication is needed. To do so, GitHub username and [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) are needed. Your token does not require any authorizations. To be automatically authorized create `credentials.json` file structured like this:\n\n```json\n{\n  \"user\": \"your_github_username\",\n  \"token\": \"personal_access_token\"\n}\n```\n\nand restart server.\n\n### Running tests and checks\n\nTo run tests or linter, make sure you are in main directory, installed `requirements.txt` and just type:\n\n**Make sure `env` is still enabled**.\n\n- run tests\n\n```bash\n  pytest\n```\n\n- to run linter `flake8` type:\n\n```bash\n  flake8 --exclude env/\n```\n\n## TODO (in the future)\n\n- [ ] add unit tests\n- [ ] add API tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercival33%2Fgithub-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercival33%2Fgithub-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercival33%2Fgithub-api/lists"}