Skip to content

sourcelocation/CoinCapSwiftAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

CoinCapSwiftAPI

A CoinCap API written on a modern language Swift.

Usage

Get assets sorted by rank:

Coincap().assets { (cryptocurrencies) in
    print(cryptocurrencies.map { $0.name })
    // Prints ["Bitcoin", "Ethereum", "Tether", "XRP" ... ]
}

Search assets:

Coincap().assets(search: "Bitcoin") { (cryptocurrencies) in
    print(cryptocurrencies.map { $0.name })
    // Prints ["Bitcoin", "Bitcoin Cash", "Bitcoin SV" ... ]
}

Search assets by id:

Coincap().assets(ids: ["bitcoin", "ethereum", "nano"]) { (cryptocurrencies) in
    print(cryptocurrencies.map { $0.name })
    // Prints ["Bitcoin", "Ethereum", "Nano"]
}