Swiftpack.co - Package - Ponyboy47/GitHub


A Swift library for interacting with the GitHub v3 REST APIs


This library support installation via the Swift Package Manager. Simply add this as a dependency in your Package.swift:

.package(url: "https://github.com/Ponyboy47/GitHub.git", from: "0.1.0")


To make gitHub API requests you must first create a GitHub object:

// Unauthenticated
let gh = GitHub()

// Username/password authentication
let gh = GitHub(username: "ponyboy47", password: "my$up3r5ecureP@ssw0rd")

// Token authentication
let gh = GitHub(token: "MY_TOKEN")

Then you use the GitHub object to make API calls:

let response: [Code] = try gh.search.code.query(keywords: "addClass", qualifiers: [.in(.file), .language("js"), .repo("jquery", user: "jquery")])

Authorizing GitHub:

Follow the steps here to create an access token.

To do:


MIT (c) 2019 Jacob Williams