PHPackages                             yidas/tw-stock-crawler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yidas/tw-stock-crawler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yidas/tw-stock-crawler
======================

Taiwan Stock Opendata Crawler with realtime - 台灣股市股票資訊擷取器

1.3.0(2y ago)24121MITPHPPHP &gt;=5.4

Since May 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yidas/tw-stock-crawler-php)[ Packagist](https://packagist.org/packages/yidas/tw-stock-crawler)[ Docs](https://github.com/yidas/tw-stock-crawler)[ RSS](/packages/yidas-tw-stock-crawler/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (7)Used By (1)

Taiwan Stock Crawler by PHP
===========================

[](#taiwan-stock-crawler-by-php)

PHP Crawler for Taiwan Stock Data (台股資料爬蟲)

[![Latest Stable Version](https://camo.githubusercontent.com/f52baf28d2a7e3c906215633bd0396dc2ba723a1bfcb648ffceaec135fc6094c/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f74772d73746f636b2d637261776c65722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/tw-stock-crawler)[![License](https://camo.githubusercontent.com/6f082df5b582cfd16d22b620bf633fa9df0298e7a5068da9043e24082b9b510c/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f74772d73746f636b2d637261776c65722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/tw-stock-crawler)

OUTLINE
-------

[](#outline)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Company Data](#company-data)
    - [Price](#price)
    - [EPS](#eps)
    - [Dividend](#dividend)
- [References](#references)

---

REQUIREMENTS
------------

[](#requirements)

This library requires the following:

- PHP 5.4.0+|7.0+

---

INSTALLATION
------------

[](#installation)

Run Composer in your project:

```
composer require yidas/tw-stock-crawler

```

Then you could call it after Composer is loaded depended on your PHP framework:

```
require __DIR__ . '/vendor/autoload.php';

use yidas\twStockCrawler\Crawler;
```

---

USAGE
-----

[](#usage)

You could first configure the crawler with source or stockId, and then call the function you need.

```
$parser = \yidas\twStockCrawler\Crawler::config(["source"=>"twse"]);
$parser::setStockId("2330");
$priceData2330 = $parser::getLastPrice();
$priceData2454 = $parser::getLastPrice("2454");
$companyData2330 = $parser::getCompanyData();
```

> Alternative source:
>
> - "Yahoo" (default): Acceptable access restrictions
> - "TWSE": Strict access restrictions

### Company Data

[](#company-data)

`Crawler::getCompanyData("2330");`:

```
Array
(
    [id] => 2330
    [isOTC] =>
    [title] => 台積電
    [industry] => 半導體
)
```

### Price

[](#price)

- Last Price

`Crawler::getLastPrice("2330");`:

```
Array
(
    [date] => 20210517
    [timestamp] => 13:30:00
    [amount] => 549
)
```

### EPS

[](#eps)

`Crawler::getEPS("2330", 2020);`

```
Array
(
    [0] => Array
        (
            [year] => 2020
            [amount] => 19.98
            [details] => Array
                (
                    [0] => Array
                        (
                            [year] => 2020
                            [belong] => Q4
                            [amount] => 5.51
                        )

                    [1] => Array
                        (
                            [year] => 2020
                            [belong] => Q3
                            [amount] => 5.3
                        )

                    [2] => Array
                        (
                            [year] => 2020
                            [belong] => Q2
                            [amount] => 4.66
                        )

                    [3] => Array
                        (
                            [year] => 2020
                            [belong] => Q1
                            [amount] => 4.51
                        )
                )
        )
)
```

### Dividend

[](#dividend)

- Dividend by year

`Crawler::getDividend("2454", 2009);`:

```
Array
(
    [year] => 2009
    [cash] => 26
    [stock] => 0.02
    [total] => 26.02
    [details] => Array
        (
            [0] => Array
                (
                    [year] => 2009
                    [belong] => 2009
                    [cash] => 26
                    [cashReleaseYear] => 2010
                    [cashReleaseDate] => 2010/08/26
                    [stock] => 0.02
                    [stockReleaseYear] =>
                    [stockReleaseDate] => 2010/08/26
                    [total] => 26.02
                )
        )
)
```

- Dividend by half year

`Crawler::getDividend("5283", 2019);`:

```
Array
(
    [year] => 2019
    [cash] => 8.16
    [stock] => 0
    [total] => 8.16
    [details] => Array
        (
            [0] => Array
                (
                    [year] => 2019
                    [belong] => H2
                    [cash] => 4.16
                    [cashReleaseYear] => 2020
                    [cashReleaseDate] => 2020/09/29
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 4.16
                )

            [1] => Array
                (
                    [year] => 2019
                    [belong] => H1
                    [cash] => 4
                    [cashReleaseYear] => 2020
                    [cashReleaseDate] => 2020/04/20
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 4
                )
        )
)
```

- Dividend by season

`Crawler::getDividend("2330", 2020);`:

```
Array
(
    [year] => 2020
    [cash] => 10
    [stock] => 0
    [total] => 10
    [details] => Array
        (
            [0] => Array
                (
                    [year] => 2020
                    [belong] => Q4
                    [cash] => 2.5
                    [cashReleaseYear] => 2021
                    [cashReleaseDate] => 2021/07/14
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 2.5
                )

            [1] => Array
                (
                    [year] => 2020
                    [belong] => Q3
                    [cash] => 2.5
                    [cashReleaseYear] => 2021
                    [cashReleaseDate] => 2021/04/14
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 2.5
                )

            [2] => Array
                (
                    [year] => 2020
                    [belong] => Q2
                    [cash] => 2.5
                    [cashReleaseYear] => 2021
                    [cashReleaseDate] => 2021/01/13
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 2.5
                )

            [3] => Array
                (
                    [year] => 2020
                    [belong] => Q1
                    [cash] => 2.5
                    [cashReleaseYear] => 2020
                    [cashReleaseDate] => 2020/10/14
                    [stock] =>
                    [stockReleaseYear] =>
                    [stockReleaseDate] =>
                    [total] => 2.5
                )
        )
)
```

---

REFERENCES
----------

[](#references)

- [Yahoo奇摩股市](https://tw.stock.yahoo.com/)
- [TWSE 臺灣證券交易所](https://www.twse.com.tw/zh/)
- [TWSE 公開資訊觀測站](https://mops.twse.com.tw/mops/web/index)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~212 days

Recently: every ~252 days

Total

6

Last Release

756d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b30d2b2c0b53aef65fad4af56cd3c7912d3db2b612890c706fe79448717f6aba?d=identicon)[yidas](/maintainers/yidas)

---

Top Contributors

[![yidas](https://avatars.githubusercontent.com/u/12604195?v=4)](https://github.com/yidas "yidas (15 commits)")

---

Tags

crawlerstocktaiwantaiwan-stock-informationtaiwan-stock-marketphpcrawlerstockTW Stock

### Embed Badge

![Health badge](/badges/yidas-tw-stock-crawler/health.svg)

```
[![Health](https://phpackages.com/badges/yidas-tw-stock-crawler/health.svg)](https://phpackages.com/packages/yidas-tw-stock-crawler)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
