npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

youbike-api

v2.0.1

Published

Youbike API Client

Readme

Youbike-API

Youbike API打包


安裝

在終端機執行此命令:

npm install youbike-api

目前可查詢縣市

  • 臺北市
  • 桃園市
  • 臺中市
  • ~~高雄市~~(API 端口不穩,暫不開放查詢)

使用方法

TypeScript

import search from "youbike-api"

//列出該縣市所有站點
search("桃園市")
    .then(console.log)

//查詢指定站點
search("桃園市", "中原大學")
    .then(console.log)

JavaScript

const search = require("youbike-api").default

//列出該縣市所有站點
search("桃園市")
    .then(console.log)

//查詢指定站點
search("桃園市", "中原大學")
    .then(console.log)

傳回資料

臺北市資料(對應TypeScript介面:TaipeiData)

[
  {
    "sno": "500101001",
    "sna": "YouBike2.0_捷運科技大樓站",
    "tot": 28,
    "sbi": 0,
    "sarea": "大安區",
    "mday": "2024-04-13 11:02:20",
    "lat": 25.02605,
    "lng": 121.5436,
    "ar": "復興南路二段235號前",
    "sareaen": "Daan Dist.",
    "snaen": "YouBike2.0_MRT Technology Bldg. Sta.",
    "aren": "No.235, Sec. 2, Fuxing S. Rd.",
    "bemp": 28,
    "act": "1",
    "srcUpdateTime": "2024-04-13 11:02:26",
    "updateTime": "2024-04-13 11:02:44",
    "infoTime": "2024-04-13 11:02:20",
    "infoDate": "2024-04-13"
  }
]

桃園市資料(對應TypeScript介面:TaoYuanData)

[
  {
    "_id": 1,
    "sno": "2001",
    "sna": "中央大學圖書館",
    "tot": "44",
    "sbi": "5",
    "sarea": "中壢區",
    "mday": "20240413105837",
    "lat": "24.968128",
    "lng": "121.194666",
    "ar": "中大路300號(中央大學校內圖書館前)",
    "sareaen": "Zhongli Dist.",
    "snaen": "National Central University Library",
    "aren": "No.300, Zhongda Rd.",
    "bemp": "34",
    "act": "1"
  }
]

臺中市資料(對應TypeScript介面:TaiChungData)

[
  {
    "scity": "台中市",
    "scityen": "Taichung City",
    "sna": "YouBike2.0_綠川東中山路口",
    "sarea": "中區",
    "ar": "綠川東街/中山路口(東側)",
    "snaen": "YouBike2.0_Luchuan E. St. / Zhongshan Rd.",
    "sareaen": "Central Dist",
    "aren": "Luchuan E. St. & Zhongshan Rd. Intersection (East)",
    "sno": "500601001",
    "tot": "16",
    "sbi": "7",
    "mday": "20240413101219",
    "lat": "24.13785",
    "lng": "120.68337",
    "bemp": "9",
    "act": 1,
    "sbi_detail": { "yb2": "7", "eyb": "0" }
  }
]

高雄市資料(對應TypeScript介面:KaoHsiungData)

注意:因 API 端口不穩,所以此模組暫不開放查詢

[
  {
    "scity": "高雄市",
    "scityen": "Kaohsiung City",
    "sna": "YouBike2.0_河北二路中庸街口",
    "sarea": "三民區",
    "ar": "河北二路192號(對面)",
    "snaen": "YouBike2.0_Hebei 2nd Rd. & Zhongyong St. Intersection",
    "sareaen": "Sanmin Dist",
    "aren": "No. 192, Hebei 2nd Rd. (Opposite)",
    "sno": "501203085",
    "tot": "10",
    "sbi": "5",
    "mday": "20210711224228",
    "lat": "22.63417",
    "lng": "120.29090",
    "bemp": "5",
    "act": 1
  }
]

API來源:

桃園開放資料:https://data.tycg.gov.tw/
政府資料開放平台:https://data.gov.tw/
高雄城市資料平台:https://api.kcg.gov.tw/

Version 2.0 更新日誌

  • 更新臺中 API 連結
  • 因高雄市 API 端口穩定性不佳,本模組暫時不開放
  • 將台北市改成 Youbike 2.0 新 API 連結