Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kremilly/ghpinnedapi

Get your pinned repositories api
https://github.com/kremilly/ghpinnedapi

api github github-pinned-api python rest-api web-api

Last synced: 9 days ago
JSON representation

Get your pinned repositories api

Awesome Lists containing this project

README

        

# ghPinnedAPI

Get your pinned repositories api

> [!warning]
> This project will no longer be updated. All new updates to this API will be made in the [**MyApis**](https://github.com/kremilly/MyApis) repository, and only security updates will be made in this current repository.

## Using the api on your project

If you want to add your pinned repositories to your portfolio or website and can't find an API that works for this, then your problems are over. I've created an API that does exactly that, and its usage is extremely easy. Simply pass your GitHub username as a query parameter.

### Example of request

```shell
https://api.kremilly.com/github?user=YOUR_USERNAME
```

> [!note]
> *Replace `YOUR_USERNAME` with your GitHub username*

> [!note]
> *We request the use of the new endpoint; however, the old one is still operational.*

### A simple example of use in JavaScript

```javascript
// Replace "kremilly" for your GitHub username
fetch('api.kremilly.com/github?user=kremilly').then(
json => json.json()
).then(callback => {
console.log(callback)
})
```

> [!note]
> *The API will return a JSON with all your pinned repositories (if any; otherwise, it will return an empty JSON)*

> [!note]
> *See [here](https://github.com/kremilly/ghPinnedAPI/tree/main/examples) others examples in others languages and using Axios.js*

#### Simple output of request:

```json
{
"description": "Get your pinned repositories api",
"forks": 0,
"home": "https://gh-pin.kremilly.com",
"languages": [
"Python",
"HTML"
],
"name": "ghPinnedAPI",
"stars": 1,
"tags": [
"api",
"github",
"python",
"github-pinned-api"
],
"url": "https://github.com/kremilly/ghPinnedAPI"
}
```

### Queries Parameters

* `user` Set the username

### Data returned by the API

* `name` Repository name (required)
* `description` Repository description (optional)
* `home` Repository home URL (optional)
* `url` Repository url on GitHub (generated by GitHub)
* `stars` Repository stars amount (default is `0`)
* `forks` Repository forks amount (default is `0`)
* `languages` Repository languages (generated by GitHub)
* `tags` Repository topics on GitHub (optional)

## Possible messages knowning

* The user does not have any pinned repositores (Status code: 200)
* User does not exist on GitHub (Status code: 404)
* Error fetching pinned repositories (Status code: 500)