Skip to content

Instantly share code, notes, and snippets.

@petrpavlik
Last active September 17, 2023 04:32
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save petrpavlik/271d40920da7b066cf6d61edc7b9022b to your computer and use it in GitHub Desktop.
Swiftpack.co API

Authorization

You need to provide Authorization header in form Basic yourtoken and User-Agent header

Endpoints

  • /api/fresh
  • /api/popular
  • /api/search

All endpoints accept offset and limit (max 1000) query params. Search endpoint also requires query endpoint.

Example

curl -H "Authorization: Basic yourtoken" https://swiftpack.co/api/fresh?limit=2

[
  {
    "fullName": "ridi/URLKit.swift",
    "numStars": 1,
    "repoURL": "https://github.com/ridi/URLKit.swift",
    "lastIndexed": "2021-04-29T18:14:01Z",
    "id": "634B7931-CA80-4755-B692-DE3BE6921BB1",
    "latestRelease": "0.2.4",
    "lastReleaseAt": "2021-04-29T18:14:01Z",
    "description": " A Swift URL* additions from RIDI",
    "pushedAt": "2021-04-29T12:14:28Z"
  },
  {
    "description": "Extensions and base classes for macOS views and windows",
    "repoURL": "https://github.com/mr-elbe5/SwiftyMacViewExtensions",
    "lastIndexed": "2021-04-29T18:10:03Z",
    "id": "B2F7FE20-2C4C-4368-B493-8DD510310CFD",
    "numStars": 0,
    "latestRelease": "1.0.3",
    "lastReleaseAt": "2021-04-29T18:10:03Z",
    "pushedAt": "2021-04-29T17:16:03Z",
    "fullName": "mr-elbe5/SwiftyMacViewExtensions"
  }
]

Requesting Access Token

Exposing the API is one big experiment and I really wonder what people will want to use it for. Please email petrpavlik@me.com or send me a twitter DM @ptrpavlik, explaning what you'd like to use the API for. Scraping the API to build your own web version of a swift package catalog is not allowed, and your token will be rejected if I find out.

@pavelaron
Copy link

Hi!
How can i get a token for the API?

@petrpavlik
Copy link
Author

@pavelaron I've just added a section how to request an API token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment