.NET Documentation¶
The following document explains how to use the Tejapi.NET API to access the TEJ database.
Installation¶
Installation
Supported Platforms¶
- .NET Core 2.0
- .NET Framework 4.6.1 or above
- Xamarin.iOS
- Xamarin.Android
- Universal Windows Platform
Supported Platforms¶
- .NET Framework 4.0 or above
Please refer to the package information of Tejapi.NET4 on nuget.org.
Or directly download Tejapi.NET4.zip here.
Authentication¶
After installation, you need to add a reference to your program.
Initialize the object and fill in your APIKEY.
Initialize the object
Usage¶
Take the listed (uncorrected) stock prices (daily) TWN/APRCD
as an example.
You can directly use the Tejapi method to retrieve the data, and the returned class is System.Data.Datatable
.
API Data Retrieval Example for Stock Prices(TWN/APRCD)
Tip
If no filter condition is provided, all data will be retrieved. It is recommended to use the filter method introduced below to add appropriate filter conditions.
Data Filtering¶
If you need to filter by column, such as only retrieving the Taiwan Weighted Stock Index (Y9999), you can directly add the column filter condition coid=Y9999
.
Single Column Filtering
Or to retrieve two indices, Y9999 and Y9998, at the same time, use the sequence condition coid=Y9999,Y9998
.
Multiple Value Selection
The data retrieval limit is up to 10,000 records per request, and you can add paginate:true
, so the system will automatically paginate the data.
Pagination for Large Data Sets
Tip
The system limits the maximum number of records to 10,000 per request. You can use the paginate:true parameter to paginate the data, but the total number of records is limited to 1,000,000. Please consider using filter conditions to reduce the number of records
You can filter by multiple columns, and conditions are separated by &
.
Multiple Column Filtering Syntax
Column Filtering¶
If you only need to retrieve a single column, use the columnFilterCriteria
condition.
For example, if you only need to retrieve the opening price column open_d
Retrieve the opening price column (open_d)
Or multiple columns, separated by a comma ,
.
For example, mdate,open_d
mdate,open_d
Data Filtering Operations¶
You can filter data by column range, such as retrieving data where the transaction date is greater than 2018-01-01.
Retrieving data where the transaction date is greater than 2018-01-01
You can filter data by column range, such as retrieving data where the transaction date is greater than 2018-01-01 and less than 2018-02-01.
Retrieving data where the transaction date is greater than 2018-01-01 and less than 2018-02-01
Filtering Operation | Description | Example |
---|---|---|
= |
Specifies that the field equals a certain value | coid=Y9999 |
> |
Specifies that the field is greate than a certain value | mdate>2018-01-01 |
< |
Specifies that the field is less than a certain value | mdate<2018-01-01 |
>= |
Specifies that the field is greater than or equal to a certain value | mdate>=2018-01-01 |
<= |
Specifies that the field is less than or equal to a certain value | mdate<=2018-01-01 |
!= |
Specifies that the field is not equal to a certain value | mdate!=2018-01-01 |
Other Query Parameters¶
Parameter | Required | Description | Example |
---|---|---|---|
perPage |
No | Specifies the number of records to retrieve per request (maximum of 10,000); total records cannot exceed 1,000,000. | perPage:100 |
sortOrder |
No | Specifies the sorting column and order, using [column_name].[sort_order] format. Sort order can be ascending (asc) or descending (desc). Default is ascending. |
sortOrder:"mdate.desc" |