bcchapi 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +12 -12
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2024 Alfredo Irarrazaval
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The Central Bank of Chile provides a web service that allows searching and extra
|
|
|
6
6
|
|
|
7
7
|
The API currently supports only to functions: `GetSeries` (default) used for retrieveng historical data on a specific series, and `SearchSeries` used for searching series by frequency code (ie: daily, monthly, quearterly or yearly).
|
|
8
8
|
|
|
9
|
-
For further information on how to use the API directly, please refer to the [official documentation](https://si3.bcentral.cl/estadisticas/Principal1/Web_Services/doc_en.htm).
|
|
9
|
+
For further information on how to use the API directly, please refer to the [official documentation](https://si3.bcentral.cl/estadisticas/Principal1/Web_Services/doc_en.htm). Usage of the API is subject to the restrictions defined in the [Terms and Conditions](https://si3.bcentral.cl/estadisticas/Principal1/Web_Services/index_BDE_TC.htm) of the Statistical Data Base API of the Central Bank of Chile. As of January of 2024, **the API allows up to 5 requests per second per user**.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -18,10 +18,10 @@ npm i -S bcchapi
|
|
|
18
18
|
|
|
19
19
|
```javascript
|
|
20
20
|
// ESM
|
|
21
|
-
import Client from 'bcchapi';
|
|
21
|
+
import { Client } from 'bcchapi';
|
|
22
22
|
|
|
23
23
|
// CommonJS
|
|
24
|
-
const Client = require('bcchapi');
|
|
24
|
+
const { Client } = require('bcchapi');
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Authentication
|
|
@@ -35,20 +35,20 @@ const client = new Client({
|
|
|
35
35
|
});
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
39
38
|
### GetSeries
|
|
40
39
|
|
|
41
40
|
Allows you to retrieve historic data series.
|
|
42
41
|
|
|
42
|
+
- Series Catalogue: [EN](https://si3.bcentral.cl/estadisticas/Principal1/Web_Services/Webservices/series_EN.xlsx) | [ES](https://si3.bcentral.cl/estadisticas/Principal1/Web_Services/Webservices/series.xlsx)
|
|
43
|
+
|
|
43
44
|
#### Parameters
|
|
44
45
|
|
|
45
46
|
| name | type | required | description | example |
|
|
46
|
-
|
|
47
|
+
| ------ | ------------------ | -------- | ------------------------------- | ---------------------- |
|
|
47
48
|
| series | `string` | Yes | The series identifier | `'F072.EUR.USD.N.O.D'` |
|
|
48
49
|
| since | `string` or `Date` | No | The starting date of the series | `'2020-12-01'` |
|
|
49
50
|
| until | `string` or `Date` | No | The ending date of the series | `'2020-12-02'` |
|
|
50
51
|
|
|
51
|
-
|
|
52
52
|
> **NOTE**: The API does not implements pagination, so if you need to retrieve a large amount of data, you should use the `since` and `until` parameters to split the request into smaller chunks.
|
|
53
53
|
|
|
54
54
|
#### Example
|
|
@@ -63,7 +63,8 @@ const series = await client.getSeries({
|
|
|
63
63
|
console.log(series);
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
_Output_
|
|
67
|
+
|
|
67
68
|
```js
|
|
68
69
|
{
|
|
69
70
|
seriesId: 'F072.EUR.USD.N.O.D',
|
|
@@ -82,21 +83,21 @@ Allows you to search for series by their frequency code (ie: daily, weekly, mont
|
|
|
82
83
|
#### Parameters
|
|
83
84
|
|
|
84
85
|
| name | type | required | description | example |
|
|
85
|
-
|
|
86
|
+
| --------- | -------- | -------- | ------------------------------------------------------------------------ | --------- |
|
|
86
87
|
| frequency | `string` | Yes | The frequency code to search (`DAILY`, `MONTHLY`, `QUARTERLY`, `ANNUAL`) | `'DAILY'` |
|
|
87
88
|
|
|
88
|
-
|
|
89
89
|
#### Example
|
|
90
90
|
|
|
91
91
|
```js
|
|
92
|
-
import {
|
|
92
|
+
import { Frequency } from 'bcchapi';
|
|
93
93
|
|
|
94
94
|
const result = await client.searchSeries({ frequency: Frequency.DAILY });
|
|
95
95
|
|
|
96
96
|
console.log(result);
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
_Output_
|
|
100
|
+
|
|
100
101
|
```js
|
|
101
102
|
[
|
|
102
103
|
...
|
|
@@ -121,4 +122,3 @@ console.log(result);
|
|
|
121
122
|
...
|
|
122
123
|
]
|
|
123
124
|
```
|
|
124
|
-
|