Swiftpack.co - Package - toniremi/PolygonioSwift

PolygonioSwift

CI Status

GitHub tag (latest SemVer)

License

Example

Simply import PolygonioSwift with:

import PolygonioSwift

then create a polygon swift object like:

let polygon = PolygonioSwift.Client(key: "YOUR_POLYGON_API_KEY")

and finally simply call any of the endpoints you want to get info from. The names are the same as in polygon.io docs.

polygon.tickers(sort: .type, type: nil, market: .Stocks, locale: nil, search: "AAPL", active: true) { (result:TickersQueryResponse?, err) in
    // check if we got any errors
    if let err = err {
        print(err)
    } else {
        // results will hold the full response as it comes from Polygon.io
        print(result)
        // the candle data is in an array inside results.tickers
        print(result?.tickers)
    }
}

Please take a look at the documentation to know what endpoints does polygon.io has and what info to expect back at https://polygon.io/docs/#getting-started.

To run the example project, clone this repo, and open iOS Example.xcworkspace from the iOS Example directory.

In the examples you can see more methods although all of them work in the same way just changes name and parameter that they will accept.

Requirements

You need to have a valid and working Polygon API Key. Please create an account at https://polygon.io/ to obtain a valid API key.

Installation

Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done. Alternative installations options are shown below for legacy projects.

CocoaPods

If you are already using CocoaPods, just add the following line to your Podfile then run pod install.

pod 'PolygonioSwift'

Carthage

If you are already using Carthage, just add to your Cartfile:


github "toniremi/PolygonioSwift" ~> 0.1

Then run carthage update to build the framework and drag the built PolygonioSwift.framework into your Xcode project.

Author

Antoni Remeseiro Alfonso

License

PolygonioSwift is available under the MIT license. See the LICENSE file for more information.

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

PolygonioSwift - 2020-09-16 03:56:34

Added more endpoints on this version to fetch single ticker snapshot and all tickers snapshot.

PolygonioSwift - 2020-09-15 01:04:39

This version is ready for release, passes all the Tests and it's ready to be used with cocoapods and Swift Package Manager.

PolygonioSwift - 2020-09-14 09:14:00

This release aims to fix a crash on Travis CI that happens after we changed the iOS example workspace name.

PolygonioSwift - 2020-09-14 09:06:08

Added more endpoints and added more code to the example project.

PolygonioSwift - 2020-09-14 07:24:13

This version is ready to be installed through Swif Package Manager and Cocoapods. This first version has enough endpoints to be used for stocks but some of the Crypo and Forex endpoints are still missing and will be added in the future.

The library is fairly easy to extend upon just need to create a decodable struct for the endpoint and add it to Client.swift.

PolygonSwift cocoapods release - 2020-09-14 07:02:54

This version should be ready to be pushed to cocoapods.

PolygonSwift 0.5.0 - 2020-09-14 05:43:12

This version is getting ready to be pushed to cocoapods but it's ready to be used with SwiftPackages.

PolygonSwift Initial Release - 2020-09-14 05:17:36

This is the first version with some of the endpoints to Polygon.io API. More endpoints will be added in the future including for Crypto and Fx.

Initial Release PolygonSwift - 2020-09-14 04:21:16

This is the first version with some of the endpoints to Polygon.io API. More endpoints will be added in the future including for Crypto and Fx.

Initial Release of PolygonSwift library - 2020-09-14 04:05:32

This is the first version with some of the endpoints to Polygon.io API. More endpoints will be added in the future including for Crypto and Fx.

Initial version of PolygonSwift - 2020-09-14 04:02:27

This is the first version with some of the endpoints to Polygon.io API. More endpoints will be added in the future including for Crypto and Fx.