oilpriceapi 0.6.0 → 0.7.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 +376 -113
- package/dist/client.d.ts +83 -3
- package/dist/client.js +104 -38
- package/dist/index.d.ts +31 -6
- package/dist/index.js +17 -3
- package/dist/resources/alerts.d.ts +52 -15
- package/dist/resources/alerts.js +143 -85
- package/dist/resources/analytics.d.ts +325 -0
- package/dist/resources/analytics.js +221 -0
- package/dist/resources/bunker-fuels.d.ts +270 -0
- package/dist/resources/bunker-fuels.js +191 -0
- package/dist/resources/commodities.d.ts +148 -0
- package/dist/resources/commodities.js +110 -0
- package/dist/resources/data-quality.d.ts +229 -0
- package/dist/resources/data-quality.js +139 -0
- package/dist/resources/data-sources.d.ts +365 -0
- package/dist/resources/data-sources.js +349 -0
- package/dist/resources/drilling.d.ts +403 -0
- package/dist/resources/drilling.js +264 -0
- package/dist/resources/ei/drilling-productivity.d.ts +173 -0
- package/dist/resources/ei/drilling-productivity.js +103 -0
- package/dist/resources/ei/forecasts.d.ts +177 -0
- package/dist/resources/ei/forecasts.js +101 -0
- package/dist/resources/ei/frac-focus.d.ts +212 -0
- package/dist/resources/ei/frac-focus.js +150 -0
- package/dist/resources/ei/index.d.ts +140 -0
- package/dist/resources/ei/index.js +87 -0
- package/dist/resources/ei/oil-inventories.d.ts +155 -0
- package/dist/resources/ei/oil-inventories.js +92 -0
- package/dist/resources/ei/opec-production.d.ts +146 -0
- package/dist/resources/ei/opec-production.js +92 -0
- package/dist/resources/ei/rig-counts.d.ts +131 -0
- package/dist/resources/ei/rig-counts.js +88 -0
- package/dist/resources/ei/well-permits.d.ts +178 -0
- package/dist/resources/ei/well-permits.js +119 -0
- package/dist/resources/forecasts.d.ts +200 -0
- package/dist/resources/forecasts.js +157 -0
- package/dist/resources/futures.d.ts +322 -0
- package/dist/resources/futures.js +228 -0
- package/dist/resources/rig-counts.d.ts +221 -0
- package/dist/resources/rig-counts.js +157 -0
- package/dist/resources/storage.d.ts +182 -0
- package/dist/resources/storage.js +161 -0
- package/dist/resources/webhooks.d.ts +290 -0
- package/dist/resources/webhooks.js +297 -0
- package/dist/types.d.ts +77 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Oil Inventories Resource
|
|
3
|
+
*
|
|
4
|
+
* Access EIA crude oil inventory data including total US stocks, Cushing levels,
|
|
5
|
+
* and regional breakdowns.
|
|
6
|
+
*/
|
|
7
|
+
import type { OilPriceAPI } from "../../client.js";
|
|
8
|
+
/**
|
|
9
|
+
* Oil inventory record
|
|
10
|
+
*/
|
|
11
|
+
export interface OilInventoryRecord {
|
|
12
|
+
/** Record ID */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Inventory level in thousand barrels */
|
|
15
|
+
level: number;
|
|
16
|
+
/** Unit of measurement */
|
|
17
|
+
unit: string;
|
|
18
|
+
/** Product type (e.g., "crude_oil", "gasoline", "distillate") */
|
|
19
|
+
product?: string;
|
|
20
|
+
/** Location (e.g., "US_TOTAL", "CUSHING", "PADD1") */
|
|
21
|
+
location?: string;
|
|
22
|
+
/** Change from previous week */
|
|
23
|
+
change?: number;
|
|
24
|
+
/** Report date */
|
|
25
|
+
date: string;
|
|
26
|
+
/** ISO timestamp */
|
|
27
|
+
timestamp: string;
|
|
28
|
+
/** Additional metadata */
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Oil inventory summary
|
|
33
|
+
*/
|
|
34
|
+
export interface OilInventorySummary {
|
|
35
|
+
/** Total US crude oil stocks */
|
|
36
|
+
total_crude: number;
|
|
37
|
+
/** Cushing stocks */
|
|
38
|
+
cushing?: number;
|
|
39
|
+
/** SPR stocks */
|
|
40
|
+
spr?: number;
|
|
41
|
+
/** Total products */
|
|
42
|
+
total_products?: number;
|
|
43
|
+
/** Unit */
|
|
44
|
+
unit: string;
|
|
45
|
+
/** As of date */
|
|
46
|
+
as_of_date: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Inventory by product type
|
|
50
|
+
*/
|
|
51
|
+
export interface InventoryByProduct {
|
|
52
|
+
/** Product type */
|
|
53
|
+
product: string;
|
|
54
|
+
/** Inventory level */
|
|
55
|
+
level: number;
|
|
56
|
+
/** Change from previous week */
|
|
57
|
+
change?: number;
|
|
58
|
+
/** Unit */
|
|
59
|
+
unit: string;
|
|
60
|
+
/** Date */
|
|
61
|
+
date: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Historical inventory data point
|
|
65
|
+
*/
|
|
66
|
+
export interface HistoricalInventory {
|
|
67
|
+
/** Date */
|
|
68
|
+
date: string;
|
|
69
|
+
/** Inventory level */
|
|
70
|
+
level: number;
|
|
71
|
+
/** Change */
|
|
72
|
+
change?: number;
|
|
73
|
+
/** Unit */
|
|
74
|
+
unit: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Cushing inventory data
|
|
78
|
+
*/
|
|
79
|
+
export interface CushingInventory {
|
|
80
|
+
/** Inventory level */
|
|
81
|
+
level: number;
|
|
82
|
+
/** Change from previous week */
|
|
83
|
+
change?: number;
|
|
84
|
+
/** Percentage of capacity */
|
|
85
|
+
capacity_percent?: number;
|
|
86
|
+
/** Unit */
|
|
87
|
+
unit: string;
|
|
88
|
+
/** Date */
|
|
89
|
+
date: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* EI Oil Inventories Resource
|
|
93
|
+
*
|
|
94
|
+
* Access EIA crude oil and petroleum product inventory data.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
99
|
+
*
|
|
100
|
+
* // Get latest inventories
|
|
101
|
+
* const latest = await client.ei.oilInventories.latest();
|
|
102
|
+
* console.log(`Total crude: ${latest.level} ${latest.unit}`);
|
|
103
|
+
*
|
|
104
|
+
* // Get Cushing stocks
|
|
105
|
+
* const cushing = await client.ei.oilInventories.cushing();
|
|
106
|
+
* console.log(`Cushing: ${cushing.level} ${cushing.unit}`);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare class EIOilInventoriesResource {
|
|
110
|
+
private client;
|
|
111
|
+
constructor(client: OilPriceAPI);
|
|
112
|
+
/**
|
|
113
|
+
* List all oil inventory records
|
|
114
|
+
*
|
|
115
|
+
* @returns Array of inventory records
|
|
116
|
+
*/
|
|
117
|
+
list(): Promise<OilInventoryRecord[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Get a specific inventory record
|
|
120
|
+
*
|
|
121
|
+
* @param id - Record ID
|
|
122
|
+
* @returns Inventory record
|
|
123
|
+
*/
|
|
124
|
+
get(id: string): Promise<OilInventoryRecord>;
|
|
125
|
+
/**
|
|
126
|
+
* Get latest oil inventory data
|
|
127
|
+
*
|
|
128
|
+
* @returns Latest inventory record
|
|
129
|
+
*/
|
|
130
|
+
latest(): Promise<OilInventoryRecord>;
|
|
131
|
+
/**
|
|
132
|
+
* Get inventory summary
|
|
133
|
+
*
|
|
134
|
+
* @returns Inventory summary across all products
|
|
135
|
+
*/
|
|
136
|
+
summary(): Promise<OilInventorySummary>;
|
|
137
|
+
/**
|
|
138
|
+
* Get inventories by product type
|
|
139
|
+
*
|
|
140
|
+
* @returns Array of inventories by product
|
|
141
|
+
*/
|
|
142
|
+
byProduct(): Promise<InventoryByProduct[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Get historical inventory data
|
|
145
|
+
*
|
|
146
|
+
* @returns Array of historical inventory levels
|
|
147
|
+
*/
|
|
148
|
+
historical(): Promise<HistoricalInventory[]>;
|
|
149
|
+
/**
|
|
150
|
+
* Get Cushing, OK inventory data
|
|
151
|
+
*
|
|
152
|
+
* @returns Cushing inventory data
|
|
153
|
+
*/
|
|
154
|
+
cushing(): Promise<CushingInventory>;
|
|
155
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Oil Inventories Resource
|
|
3
|
+
*
|
|
4
|
+
* Access EIA crude oil inventory data including total US stocks, Cushing levels,
|
|
5
|
+
* and regional breakdowns.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* EI Oil Inventories Resource
|
|
9
|
+
*
|
|
10
|
+
* Access EIA crude oil and petroleum product inventory data.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
15
|
+
*
|
|
16
|
+
* // Get latest inventories
|
|
17
|
+
* const latest = await client.ei.oilInventories.latest();
|
|
18
|
+
* console.log(`Total crude: ${latest.level} ${latest.unit}`);
|
|
19
|
+
*
|
|
20
|
+
* // Get Cushing stocks
|
|
21
|
+
* const cushing = await client.ei.oilInventories.cushing();
|
|
22
|
+
* console.log(`Cushing: ${cushing.level} ${cushing.unit}`);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class EIOilInventoriesResource {
|
|
26
|
+
constructor(client) {
|
|
27
|
+
this.client = client;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List all oil inventory records
|
|
31
|
+
*
|
|
32
|
+
* @returns Array of inventory records
|
|
33
|
+
*/
|
|
34
|
+
async list() {
|
|
35
|
+
const response = await this.client["request"]("/v1/ei/oil_inventories", {});
|
|
36
|
+
return Array.isArray(response) ? response : response.data;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get a specific inventory record
|
|
40
|
+
*
|
|
41
|
+
* @param id - Record ID
|
|
42
|
+
* @returns Inventory record
|
|
43
|
+
*/
|
|
44
|
+
async get(id) {
|
|
45
|
+
if (!id || typeof id !== "string") {
|
|
46
|
+
throw new Error("Record ID must be a non-empty string");
|
|
47
|
+
}
|
|
48
|
+
return this.client["request"](`/v1/ei/oil_inventories/${id}`, {});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get latest oil inventory data
|
|
52
|
+
*
|
|
53
|
+
* @returns Latest inventory record
|
|
54
|
+
*/
|
|
55
|
+
async latest() {
|
|
56
|
+
return this.client["request"]("/v1/ei/oil_inventories/latest", {});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get inventory summary
|
|
60
|
+
*
|
|
61
|
+
* @returns Inventory summary across all products
|
|
62
|
+
*/
|
|
63
|
+
async summary() {
|
|
64
|
+
return this.client["request"]("/v1/ei/oil_inventories/summary", {});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get inventories by product type
|
|
68
|
+
*
|
|
69
|
+
* @returns Array of inventories by product
|
|
70
|
+
*/
|
|
71
|
+
async byProduct() {
|
|
72
|
+
const response = await this.client["request"]("/v1/ei/oil_inventories/by_product", {});
|
|
73
|
+
return Array.isArray(response) ? response : response.data;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get historical inventory data
|
|
77
|
+
*
|
|
78
|
+
* @returns Array of historical inventory levels
|
|
79
|
+
*/
|
|
80
|
+
async historical() {
|
|
81
|
+
const response = await this.client["request"]("/v1/ei/oil_inventories/historical", {});
|
|
82
|
+
return Array.isArray(response) ? response : response.data;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get Cushing, OK inventory data
|
|
86
|
+
*
|
|
87
|
+
* @returns Cushing inventory data
|
|
88
|
+
*/
|
|
89
|
+
async cushing() {
|
|
90
|
+
return this.client["request"]("/v1/ei/oil_inventories/cushing", {});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - OPEC Production Resource
|
|
3
|
+
*
|
|
4
|
+
* Access OPEC crude oil production data by country with historical trends.
|
|
5
|
+
*/
|
|
6
|
+
import type { OilPriceAPI } from "../../client.js";
|
|
7
|
+
/**
|
|
8
|
+
* OPEC production record
|
|
9
|
+
*/
|
|
10
|
+
export interface OPECProductionRecord {
|
|
11
|
+
/** Record ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Country name */
|
|
14
|
+
country?: string;
|
|
15
|
+
/** Production volume in barrels per day */
|
|
16
|
+
production_bpd: number;
|
|
17
|
+
/** Unit of measurement */
|
|
18
|
+
unit: string;
|
|
19
|
+
/** Change from previous month */
|
|
20
|
+
change?: number;
|
|
21
|
+
/** Report date */
|
|
22
|
+
date: string;
|
|
23
|
+
/** Month */
|
|
24
|
+
month?: string;
|
|
25
|
+
/** ISO timestamp */
|
|
26
|
+
timestamp: string;
|
|
27
|
+
/** Additional metadata */
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Total OPEC production
|
|
32
|
+
*/
|
|
33
|
+
export interface TotalOPECProduction {
|
|
34
|
+
/** Total production in barrels per day */
|
|
35
|
+
total_production_bpd: number;
|
|
36
|
+
/** Change from previous month */
|
|
37
|
+
change?: number;
|
|
38
|
+
/** Unit */
|
|
39
|
+
unit: string;
|
|
40
|
+
/** As of date */
|
|
41
|
+
as_of_date: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Production by country
|
|
45
|
+
*/
|
|
46
|
+
export interface ProductionByCountry {
|
|
47
|
+
/** Country name */
|
|
48
|
+
country: string;
|
|
49
|
+
/** Production in barrels per day */
|
|
50
|
+
production_bpd: number;
|
|
51
|
+
/** Change from previous month */
|
|
52
|
+
change?: number;
|
|
53
|
+
/** Percentage of total OPEC production */
|
|
54
|
+
percentage?: number;
|
|
55
|
+
/** Date */
|
|
56
|
+
date: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Historical production data point
|
|
60
|
+
*/
|
|
61
|
+
export interface HistoricalProduction {
|
|
62
|
+
/** Date */
|
|
63
|
+
date: string;
|
|
64
|
+
/** Production in barrels per day */
|
|
65
|
+
production_bpd: number;
|
|
66
|
+
/** Change */
|
|
67
|
+
change?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Top producer data
|
|
71
|
+
*/
|
|
72
|
+
export interface TopProducer {
|
|
73
|
+
/** Country name */
|
|
74
|
+
country: string;
|
|
75
|
+
/** Production in barrels per day */
|
|
76
|
+
production_bpd: number;
|
|
77
|
+
/** Percentage of total */
|
|
78
|
+
percentage: number;
|
|
79
|
+
/** Rank */
|
|
80
|
+
rank: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* EI OPEC Production Resource
|
|
84
|
+
*
|
|
85
|
+
* Access OPEC crude oil production data and analytics.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
90
|
+
*
|
|
91
|
+
* // Get total OPEC production
|
|
92
|
+
* const total = await client.ei.opecProduction.total();
|
|
93
|
+
* console.log(`Total OPEC: ${total.total_production_bpd} bpd`);
|
|
94
|
+
*
|
|
95
|
+
* // Get top producers
|
|
96
|
+
* const top = await client.ei.opecProduction.topProducers();
|
|
97
|
+
* top.forEach(p => console.log(`${p.rank}. ${p.country}: ${p.production_bpd} bpd`));
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare class EIOPECProductionResource {
|
|
101
|
+
private client;
|
|
102
|
+
constructor(client: OilPriceAPI);
|
|
103
|
+
/**
|
|
104
|
+
* List all OPEC production records
|
|
105
|
+
*
|
|
106
|
+
* @returns Array of production records
|
|
107
|
+
*/
|
|
108
|
+
list(): Promise<OPECProductionRecord[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Get a specific production record
|
|
111
|
+
*
|
|
112
|
+
* @param id - Record ID
|
|
113
|
+
* @returns Production record
|
|
114
|
+
*/
|
|
115
|
+
get(id: string): Promise<OPECProductionRecord>;
|
|
116
|
+
/**
|
|
117
|
+
* Get latest OPEC production data
|
|
118
|
+
*
|
|
119
|
+
* @returns Latest production record
|
|
120
|
+
*/
|
|
121
|
+
latest(): Promise<OPECProductionRecord>;
|
|
122
|
+
/**
|
|
123
|
+
* Get total OPEC production
|
|
124
|
+
*
|
|
125
|
+
* @returns Total OPEC production summary
|
|
126
|
+
*/
|
|
127
|
+
total(): Promise<TotalOPECProduction>;
|
|
128
|
+
/**
|
|
129
|
+
* Get production by country
|
|
130
|
+
*
|
|
131
|
+
* @returns Array of production by country
|
|
132
|
+
*/
|
|
133
|
+
byCountry(): Promise<ProductionByCountry[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Get historical production data
|
|
136
|
+
*
|
|
137
|
+
* @returns Array of historical production levels
|
|
138
|
+
*/
|
|
139
|
+
historical(): Promise<HistoricalProduction[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Get top OPEC producers
|
|
142
|
+
*
|
|
143
|
+
* @returns Array of top producing countries
|
|
144
|
+
*/
|
|
145
|
+
topProducers(): Promise<TopProducer[]>;
|
|
146
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - OPEC Production Resource
|
|
3
|
+
*
|
|
4
|
+
* Access OPEC crude oil production data by country with historical trends.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* EI OPEC Production Resource
|
|
8
|
+
*
|
|
9
|
+
* Access OPEC crude oil production data and analytics.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
14
|
+
*
|
|
15
|
+
* // Get total OPEC production
|
|
16
|
+
* const total = await client.ei.opecProduction.total();
|
|
17
|
+
* console.log(`Total OPEC: ${total.total_production_bpd} bpd`);
|
|
18
|
+
*
|
|
19
|
+
* // Get top producers
|
|
20
|
+
* const top = await client.ei.opecProduction.topProducers();
|
|
21
|
+
* top.forEach(p => console.log(`${p.rank}. ${p.country}: ${p.production_bpd} bpd`));
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export class EIOPECProductionResource {
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List all OPEC production records
|
|
30
|
+
*
|
|
31
|
+
* @returns Array of production records
|
|
32
|
+
*/
|
|
33
|
+
async list() {
|
|
34
|
+
const response = await this.client["request"]("/v1/ei/opec_productions", {});
|
|
35
|
+
return Array.isArray(response) ? response : response.data;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get a specific production record
|
|
39
|
+
*
|
|
40
|
+
* @param id - Record ID
|
|
41
|
+
* @returns Production record
|
|
42
|
+
*/
|
|
43
|
+
async get(id) {
|
|
44
|
+
if (!id || typeof id !== "string") {
|
|
45
|
+
throw new Error("Record ID must be a non-empty string");
|
|
46
|
+
}
|
|
47
|
+
return this.client["request"](`/v1/ei/opec_productions/${id}`, {});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get latest OPEC production data
|
|
51
|
+
*
|
|
52
|
+
* @returns Latest production record
|
|
53
|
+
*/
|
|
54
|
+
async latest() {
|
|
55
|
+
return this.client["request"]("/v1/ei/opec_productions/latest", {});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get total OPEC production
|
|
59
|
+
*
|
|
60
|
+
* @returns Total OPEC production summary
|
|
61
|
+
*/
|
|
62
|
+
async total() {
|
|
63
|
+
return this.client["request"]("/v1/ei/opec_productions/total", {});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get production by country
|
|
67
|
+
*
|
|
68
|
+
* @returns Array of production by country
|
|
69
|
+
*/
|
|
70
|
+
async byCountry() {
|
|
71
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/by_country", {});
|
|
72
|
+
return Array.isArray(response) ? response : response.data;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get historical production data
|
|
76
|
+
*
|
|
77
|
+
* @returns Array of historical production levels
|
|
78
|
+
*/
|
|
79
|
+
async historical() {
|
|
80
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/historical", {});
|
|
81
|
+
return Array.isArray(response) ? response : response.data;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get top OPEC producers
|
|
85
|
+
*
|
|
86
|
+
* @returns Array of top producing countries
|
|
87
|
+
*/
|
|
88
|
+
async topProducers() {
|
|
89
|
+
const response = await this.client["request"]("/v1/ei/opec_productions/top_producers", {});
|
|
90
|
+
return Array.isArray(response) ? response : response.data;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Rig Counts Resource
|
|
3
|
+
*
|
|
4
|
+
* Access Baker Hughes rig count data with basin, state, and historical breakdowns.
|
|
5
|
+
*/
|
|
6
|
+
import type { OilPriceAPI } from "../../client.js";
|
|
7
|
+
/**
|
|
8
|
+
* Rig count record
|
|
9
|
+
*/
|
|
10
|
+
export interface RigCountRecord {
|
|
11
|
+
/** Record ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Total rig count */
|
|
14
|
+
total_rigs: number;
|
|
15
|
+
/** Oil rigs */
|
|
16
|
+
oil_rigs?: number;
|
|
17
|
+
/** Gas rigs */
|
|
18
|
+
gas_rigs?: number;
|
|
19
|
+
/** Miscellaneous rigs */
|
|
20
|
+
misc_rigs?: number;
|
|
21
|
+
/** Report date */
|
|
22
|
+
date: string;
|
|
23
|
+
/** Week number */
|
|
24
|
+
week?: number;
|
|
25
|
+
/** ISO timestamp */
|
|
26
|
+
timestamp: string;
|
|
27
|
+
/** Additional metadata */
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Rig count by basin
|
|
32
|
+
*/
|
|
33
|
+
export interface RigCountByBasin {
|
|
34
|
+
/** Basin name */
|
|
35
|
+
basin: string;
|
|
36
|
+
/** Rig count */
|
|
37
|
+
rig_count: number;
|
|
38
|
+
/** Change from previous week */
|
|
39
|
+
change?: number;
|
|
40
|
+
/** Date */
|
|
41
|
+
date: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Rig count by state
|
|
45
|
+
*/
|
|
46
|
+
export interface RigCountByState {
|
|
47
|
+
/** State name */
|
|
48
|
+
state: string;
|
|
49
|
+
/** Rig count */
|
|
50
|
+
rig_count: number;
|
|
51
|
+
/** Change from previous week */
|
|
52
|
+
change?: number;
|
|
53
|
+
/** Date */
|
|
54
|
+
date: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Historical rig count data point
|
|
58
|
+
*/
|
|
59
|
+
export interface HistoricalRigCount {
|
|
60
|
+
/** Date */
|
|
61
|
+
date: string;
|
|
62
|
+
/** Total rigs */
|
|
63
|
+
total_rigs: number;
|
|
64
|
+
/** Oil rigs */
|
|
65
|
+
oil_rigs?: number;
|
|
66
|
+
/** Gas rigs */
|
|
67
|
+
gas_rigs?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* EI Rig Counts Resource
|
|
71
|
+
*
|
|
72
|
+
* Access Baker Hughes rig count data with comprehensive breakdowns.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
77
|
+
*
|
|
78
|
+
* // Get latest rig count
|
|
79
|
+
* const latest = await client.ei.rigCounts.latest();
|
|
80
|
+
* console.log(`Total rigs: ${latest.total_rigs}`);
|
|
81
|
+
*
|
|
82
|
+
* // Get by basin
|
|
83
|
+
* const basins = await client.ei.rigCounts.byBasin();
|
|
84
|
+
* basins.forEach(b => console.log(`${b.basin}: ${b.rig_count} rigs`));
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare class EIRigCountsResource {
|
|
88
|
+
private client;
|
|
89
|
+
constructor(client: OilPriceAPI);
|
|
90
|
+
/**
|
|
91
|
+
* List all rig count records
|
|
92
|
+
*
|
|
93
|
+
* @returns Array of rig count records
|
|
94
|
+
*
|
|
95
|
+
* @throws {OilPriceAPIError} If API request fails
|
|
96
|
+
*/
|
|
97
|
+
list(): Promise<RigCountRecord[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Get a specific rig count record
|
|
100
|
+
*
|
|
101
|
+
* @param id - Record ID
|
|
102
|
+
* @returns Rig count record
|
|
103
|
+
*
|
|
104
|
+
* @throws {NotFoundError} If record not found
|
|
105
|
+
*/
|
|
106
|
+
get(id: string): Promise<RigCountRecord>;
|
|
107
|
+
/**
|
|
108
|
+
* Get latest rig count
|
|
109
|
+
*
|
|
110
|
+
* @returns Latest rig count data
|
|
111
|
+
*/
|
|
112
|
+
latest(): Promise<RigCountRecord>;
|
|
113
|
+
/**
|
|
114
|
+
* Get rig counts by basin
|
|
115
|
+
*
|
|
116
|
+
* @returns Array of rig counts by basin
|
|
117
|
+
*/
|
|
118
|
+
byBasin(): Promise<RigCountByBasin[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Get rig counts by state
|
|
121
|
+
*
|
|
122
|
+
* @returns Array of rig counts by state
|
|
123
|
+
*/
|
|
124
|
+
byState(): Promise<RigCountByState[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get historical rig count data
|
|
127
|
+
*
|
|
128
|
+
* @returns Array of historical rig counts
|
|
129
|
+
*/
|
|
130
|
+
historical(): Promise<HistoricalRigCount[]>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Energy Intelligence - Rig Counts Resource
|
|
3
|
+
*
|
|
4
|
+
* Access Baker Hughes rig count data with basin, state, and historical breakdowns.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* EI Rig Counts Resource
|
|
8
|
+
*
|
|
9
|
+
* Access Baker Hughes rig count data with comprehensive breakdowns.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const client = new OilPriceAPI({ apiKey: 'your_key' });
|
|
14
|
+
*
|
|
15
|
+
* // Get latest rig count
|
|
16
|
+
* const latest = await client.ei.rigCounts.latest();
|
|
17
|
+
* console.log(`Total rigs: ${latest.total_rigs}`);
|
|
18
|
+
*
|
|
19
|
+
* // Get by basin
|
|
20
|
+
* const basins = await client.ei.rigCounts.byBasin();
|
|
21
|
+
* basins.forEach(b => console.log(`${b.basin}: ${b.rig_count} rigs`));
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export class EIRigCountsResource {
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List all rig count records
|
|
30
|
+
*
|
|
31
|
+
* @returns Array of rig count records
|
|
32
|
+
*
|
|
33
|
+
* @throws {OilPriceAPIError} If API request fails
|
|
34
|
+
*/
|
|
35
|
+
async list() {
|
|
36
|
+
const response = await this.client["request"]("/v1/ei/rig_counts", {});
|
|
37
|
+
return Array.isArray(response) ? response : response.data;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get a specific rig count record
|
|
41
|
+
*
|
|
42
|
+
* @param id - Record ID
|
|
43
|
+
* @returns Rig count record
|
|
44
|
+
*
|
|
45
|
+
* @throws {NotFoundError} If record not found
|
|
46
|
+
*/
|
|
47
|
+
async get(id) {
|
|
48
|
+
if (!id || typeof id !== "string") {
|
|
49
|
+
throw new Error("Record ID must be a non-empty string");
|
|
50
|
+
}
|
|
51
|
+
return this.client["request"](`/v1/ei/rig_counts/${id}`, {});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get latest rig count
|
|
55
|
+
*
|
|
56
|
+
* @returns Latest rig count data
|
|
57
|
+
*/
|
|
58
|
+
async latest() {
|
|
59
|
+
return this.client["request"]("/v1/ei/rig_counts/latest", {});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get rig counts by basin
|
|
63
|
+
*
|
|
64
|
+
* @returns Array of rig counts by basin
|
|
65
|
+
*/
|
|
66
|
+
async byBasin() {
|
|
67
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/by_basin", {});
|
|
68
|
+
return Array.isArray(response) ? response : response.data;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get rig counts by state
|
|
72
|
+
*
|
|
73
|
+
* @returns Array of rig counts by state
|
|
74
|
+
*/
|
|
75
|
+
async byState() {
|
|
76
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/by_state", {});
|
|
77
|
+
return Array.isArray(response) ? response : response.data;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get historical rig count data
|
|
81
|
+
*
|
|
82
|
+
* @returns Array of historical rig counts
|
|
83
|
+
*/
|
|
84
|
+
async historical() {
|
|
85
|
+
const response = await this.client["request"]("/v1/ei/rig_counts/historical", {});
|
|
86
|
+
return Array.isArray(response) ? response : response.data;
|
|
87
|
+
}
|
|
88
|
+
}
|