@apiverve/treasuryyields 1.1.14 → 1.2.0
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/README.md +32 -9
- package/index.d.ts +33 -6
- package/index.js +1 -1
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Treasury Yields API
|
|
2
2
|
|
|
3
|
-
Treasury Yields provides current and historical
|
|
3
|
+
Treasury Yields provides current and historical US Treasury constant-maturity market yields across the full curve (1-month through 30-year), plus TIPS real yields. Essential data for yield curve analysis and fixed income research.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
[](https://www.npmjs.com/package/@apiverve/treasuryyields)
|
|
9
9
|
|
|
10
|
-
This is a Javascript Wrapper for the [Treasury Yields API](https://apiverve.com
|
|
10
|
+
This is a Javascript Wrapper for the [Treasury Yields API](https://treasuryyields.apiverve.com?utm_source=npm&utm_medium=readme)
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -60,8 +60,8 @@ Using the API is simple. All you have to do is make a request. The API will retu
|
|
|
60
60
|
|
|
61
61
|
```javascript
|
|
62
62
|
var query = {
|
|
63
|
-
date: "
|
|
64
|
-
type: "
|
|
63
|
+
date: "2025-06",
|
|
64
|
+
type: "10yr"
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
api.execute(query, function (error, data) {
|
|
@@ -81,8 +81,8 @@ You can also use promises to make requests. The API returns a promise that you c
|
|
|
81
81
|
|
|
82
82
|
```javascript
|
|
83
83
|
var query = {
|
|
84
|
-
date: "
|
|
85
|
-
type: "
|
|
84
|
+
date: "2025-06",
|
|
85
|
+
type: "10yr"
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
api.execute(query)
|
|
@@ -103,8 +103,8 @@ You can also use async/await to make requests. The API returns a promise that yo
|
|
|
103
103
|
```javascript
|
|
104
104
|
async function makeRequest() {
|
|
105
105
|
var query = {
|
|
106
|
-
date: "
|
|
107
|
-
type: "
|
|
106
|
+
date: "2025-06",
|
|
107
|
+
type: "10yr"
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
try {
|
|
@@ -130,7 +130,30 @@ async function makeRequest() {
|
|
|
130
130
|
"notes": 4.35,
|
|
131
131
|
"bonds": 4.67,
|
|
132
132
|
"tips": 2.15,
|
|
133
|
-
"frn": 5.31
|
|
133
|
+
"frn": 5.31,
|
|
134
|
+
"changes": {
|
|
135
|
+
"bills": {
|
|
136
|
+
"change1d": 0.02,
|
|
137
|
+
"direction": "up"
|
|
138
|
+
},
|
|
139
|
+
"notes": {
|
|
140
|
+
"change1d": -0.03,
|
|
141
|
+
"direction": "down"
|
|
142
|
+
},
|
|
143
|
+
"bonds": {
|
|
144
|
+
"change1d": 0.01,
|
|
145
|
+
"direction": "up"
|
|
146
|
+
},
|
|
147
|
+
"tips": {
|
|
148
|
+
"change1d": 0,
|
|
149
|
+
"direction": "unchanged"
|
|
150
|
+
},
|
|
151
|
+
"frn": {
|
|
152
|
+
"change1d": 0.02,
|
|
153
|
+
"direction": "up"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"previousDate": "2024-01-31"
|
|
134
157
|
}
|
|
135
158
|
}
|
|
136
159
|
```
|
package/index.d.ts
CHANGED
|
@@ -4,21 +4,48 @@ declare module '@apiverve/treasuryyields' {
|
|
|
4
4
|
secure?: boolean;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Describes fields the current plan does not unlock. Locked fields arrive as null
|
|
9
|
+
* in `data`; `locked_fields` names them, using dot paths for nested fields.
|
|
10
|
+
* Absent when the plan unlocks everything.
|
|
11
|
+
*/
|
|
12
|
+
export interface PremiumInfo {
|
|
13
|
+
message: string;
|
|
14
|
+
upgrade_url: string;
|
|
15
|
+
locked_fields: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
7
18
|
export interface treasuryyieldsResponse {
|
|
8
19
|
status: string;
|
|
9
20
|
error: string | null;
|
|
10
21
|
data: TreasuryYieldsData;
|
|
11
22
|
code?: number;
|
|
23
|
+
premium?: PremiumInfo;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
|
|
15
27
|
interface TreasuryYieldsData {
|
|
16
|
-
date:
|
|
17
|
-
bills:
|
|
18
|
-
notes:
|
|
19
|
-
bonds:
|
|
20
|
-
tips:
|
|
21
|
-
frn:
|
|
28
|
+
date: Date | null;
|
|
29
|
+
bills: number | null;
|
|
30
|
+
notes: number | null;
|
|
31
|
+
bonds: number | null;
|
|
32
|
+
tips: number | null;
|
|
33
|
+
frn: number | null;
|
|
34
|
+
changes: Changes;
|
|
35
|
+
previousDate: Date | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Changes {
|
|
39
|
+
bills: Bills;
|
|
40
|
+
notes: Bills;
|
|
41
|
+
bonds: Bills;
|
|
42
|
+
tips: Bills;
|
|
43
|
+
frn: Bills;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface Bills {
|
|
47
|
+
change1D: number | null;
|
|
48
|
+
direction: null | string;
|
|
22
49
|
}
|
|
23
50
|
|
|
24
51
|
export default class treasuryyieldsWrapper {
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@ class treasuryyieldsWrapper {
|
|
|
30
30
|
this.baseURL = 'https://api.apiverve.com/v1/treasuryyields';
|
|
31
31
|
|
|
32
32
|
// Validation rules for parameters (generated from schema)
|
|
33
|
-
this.validationRules = {"date":{"type":"string","required":false
|
|
33
|
+
this.validationRules = {"date":{"type":"string","required":false},"type":{"type":"string","required":false}};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/treasuryyields",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Treasury Yields provides current and historical
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Treasury Yields provides current and historical US Treasury constant-maturity market yields across the full curve (1-month through 30-year), plus TIPS real yields. Essential data for yield curve analysis and fixed income research.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=18.0.0"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"directory": "npm"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
|
-
""
|
|
26
|
+
"treasury yields", "t-bill rates", "treasury bonds", "treasury notes", "tips rates"
|
|
27
27
|
],
|
|
28
28
|
"author": {
|
|
29
29
|
"name": "APIVerve",
|
|
@@ -34,15 +34,14 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/apiverve/treasuryyields-api/issues"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://apiverve.com
|
|
37
|
+
"homepage": "https://treasuryyields.apiverve.com?utm_source=npm&utm_medium=homepage",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"mocha": "^11.0.1",
|
|
40
40
|
"chai": "^5.1.2",
|
|
41
41
|
"dotenv": "^16.4.7"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"axios": "1.13.2"
|
|
44
|
+
"axios": "1.13.2",
|
|
45
|
+
"form-data": "^4.0.1"
|
|
47
46
|
}
|
|
48
47
|
}
|