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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tainan-open-1999

v0.3.0

Published

Tainan open 1999 API

Readme

tainan-open-1999

Build Status Coverage Status

A NodeJS wrapper around Tainan Open 1999 API.

Installation

Install module via NPM

$ npm install tainan-open-1999

Or, using yarn

$ yarn

Example

A simple example for request a case of car illegal parking report on Tainan Open 1999.

const tainanOpen1999 = require('tainan-open-1999')

tainanOpen1999.getCase('UN201704030185', (err, data) => {
  if (err) {
    return console.error(error)
  }
  console.log(data)
})

The output,

{
  caseId: 'UN201704030185',
  status: '已完工',
  district: '東區',
  serviceName: '違規停車',
  subjectName: '違規停車',
  agency: '臺南市政府警察局勤務指揮中心',
  description: '東區崇德路,介於林森路一段與監理站間 違停',
  address: '東區崇德路',
  latitude: null,
  longitude: null,
  createAt: '2017-04-03 19:27:00',
  updateAt: '2017-04-04 02:08:22',
  pictures: []
}

Resource Object

The responsed resources are preprocessed by wrapping a proper object structure for usage. Those objects below will be mentioned in the entire document..

Object:Case

  • caseId: A string the case ID
  • status: A number of the case status code, 0 for unprocessed, 1 for processed
  • district: A string of Tainan City administrative district
  • serviceName: A string of the service name
  • subjectName: A string of the subject name
  • agency: A string of the agency
  • description: A string of the case description
  • address: A string of the address
  • latitude: A string of the latitude
  • longitude: A string of the longitude
  • createAt: A string of time (YYYY-MM-DD hh:mm:ss)
  • updateAt: A string of time (YYYY-MM-DD hh:mm:ss)
  • pictures: An array of <Object:Picture>

Object:Picture

  • fileName: A string of the image file name
  • description: A string of the image description
  • base64: A string of the image base64 encode

Object:Service

  • code: A string of the service code
  • name: A string of the service name
  • subjects: An array of <Object:Subject>

Object:Subject

  • code: A string of the subject code
  • name: A string of the subject name

API Reference

All the methods of resource request are asynchronously handled by the given callback function.

method(...argus, (err, data) => {
  // access the resource
})

The callback function gets passed two arguments. The first argument returned the error message when failed. The second argument returned the data when succeeded.

addCase(options, callback)

Those options below are reuqired:

  • serviceName: A string of the service name
  • subjectName: A string of the subject name
  • district: A string of the district
  • address: A string of the address
  • description: A string of the description
  • reporterName: A string of the reporter name
  • reporterPhoneNumber: A string of the reporter number

Others are optional:

  • reporterEmail: A string of reporter email
  • latitude: A string of latitude
  • longitude: A string of longtitude
  • pictures: An array of <Object:Picture>

The return data argument of the callback:

  • caseId: A string of the case ID

getCase(caseId, callback)

  • caseId: A string of case ID

The returned data argument of the callback:

  • <Object:Case>

getCases(options, callback)

Those options below are reuqired:

  • startFrom: A string of time (YYYY-MM-DD hh:mm:ss)
  • endTo: A string of time (YYYY-MM-DD hh:mm:ss)

Others are optional:

  • serviceName: A string or an array of service name

The returned data argument of the callback:

  • num: A number of entry count
  • cases: An array of <Object:Case>

getCasesByIds(caseIds, callback)

  • caseIds: An array of case ID string

The returned data argument of the callback:

  • num: A number of entry count
  • cases: An array of <Object:Case>

getServices(callback)

The returned data argument of the callback:

  • num: A number of entry count
  • services: An array of <Object:Service>