目录
目录README.md

StocksAPI

This is a library that leverages Yahoo Finance REST API and provides very simple and Swiftly way to interact with it.

Features

  • Fetch Chart data for 1d, 1w, 1mo, 3mo, 6mo, 1y, 2y, 5y, YTD, max.
  • Search Ticker using query.
  • Fetch quotes using ticker symbols.
  • Swift Async Await Interface.
  • Fetch Raw JSON data.

Usecase

Initialize repository

First of all, you need to import and initalize the StocksAPI.

import StocksAPI

let api = StocksAPI()

Fetch TSLA stocks last 1 week

let tesla1wkChart = try await api.fetchChartData(tickerSymbol: "TSLA", range: .oneWeek)
let tickers = try await api.searchTickers(query: "TESLA")

Fetch Quote Detail for multiple symbols TSLA, GOOG, AAPL, MSFT

let quotes = try await api.fetchQuotes(symbols: "TSLA,GOOG,AAPL,MSFT")

Installation Guide

Swift Package Manager

Here is how you proceed to add it to your project:

This is entirely Powered by Yahoo Finance API https://www.yahoo.com/?ilc=401

Yahoo Finance REST API Postman Collection Download Link: https://drive.google.com/file/d/1GzLBLGSE4nRjjj-bI0nSV0Un5VGiKO5j/view

关于
55.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号