apiverve_gdp 1.2.4 → 1.2.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db8b0c6cbbec88fbd823fedc210be9b6f2fa730f8708451b50d84cb6768b1ebf
4
- data.tar.gz: a8774d5e3cbb4b472e4bee3f9910d2bdadf8f4f5f39a5915bc34d3017cad5713
3
+ metadata.gz: 490e06eb31ff9dfd44615489a941973ad60c7ccf169abbd2f9ce04c3150474c2
4
+ data.tar.gz: a7383f9acba373d14fbe85163deef70a4c47acf5b125e6e35a95731be24be1f2
5
5
  SHA512:
6
- metadata.gz: 556ffa44decbfab9db726399b089538b7ad572314a7237bb76a26395d33d0e7c085345d390232eb1383463dbff29082def51c2b7cbf2c4bae677cb004cd849f6
7
- data.tar.gz: 120c7fc36d187c7d0001bb8a69185d134a027ddd74fe0bebedb632c8db687a15e5990987595d4768d343ad1aba8f62a7292747007b6aaec578cd926a99ffc689
6
+ metadata.gz: eb76637cffede052d44fd86f06ea5dd30fe0d4df510527bae71f2766eeba1581c802b59eeaca28bcd823efa1e754a8c965b569aadd8b527aaeeff1b6c17b9cb5
7
+ data.tar.gz: 5f3fe65c05a412db90a4b1549176361670bb596d4e25645298659935663f03a498b91fbea6390cc8edabbcb87fe22bf3b0045646032ccaae56659c4271c14d36
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GDP Data API - Ruby Gem
2
2
 
3
- Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960.
3
+ Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960. With changes=true it also returns the direction against the previous year, and on paid plans the prior year's GDP, the dollar and percent change, whether real growth is accelerating or slowing, and 5- and 10-year compound annual growth.
4
4
 
5
5
  ## Installation
6
6
 
@@ -37,7 +37,8 @@ client = APIVerve::Gdp::Client.new(api_key: "YOUR_API_KEY")
37
37
  # Make a request
38
38
  response = client.execute({
39
39
  country: "US",
40
- year: 2023
40
+ year: 2023,
41
+ changes: true
41
42
  })
42
43
 
43
44
  # Print the response
@@ -49,7 +50,7 @@ puts response
49
50
 
50
51
  ```ruby
51
52
  begin
52
- response = client.execute({ country: "US", year: 2023 })
53
+ response = client.execute({ country: "US", year: 2023, changes: true })
53
54
  puts response["data"]
54
55
  rescue APIVerve::Gdp::ValidationError => e
55
56
  puts "Validation error: #{e.errors.join(', ')}"
@@ -79,21 +80,32 @@ client = APIVerve::Gdp::Client.new(
79
80
  "country": "US",
80
81
  "countryName": "United States",
81
82
  "currency": "USD",
82
- "year": 2023,
83
- "gdp": 27360935000000,
84
- "gdpFormatted": "$27.36 trillion",
85
- "gdpGrowth": 2.54,
86
- "gdpPerCapita": 81632,
83
+ "year": 2025,
84
+ "gdp": 30769700000000,
85
+ "gdpFormatted": "$30.77 trillion",
86
+ "gdpGrowth": 2.16,
87
+ "gdpPerCapita": 90027,
87
88
  "count": 1,
88
89
  "years": [
89
90
  {
90
- "year": 2023,
91
- "gdp": 27360935000000,
92
- "gdpFormatted": "$27.36 trillion",
93
- "gdpGrowth": 2.54,
94
- "gdpPerCapita": 81632
91
+ "year": 2025,
92
+ "gdp": 30769700000000,
93
+ "gdpFormatted": "$30.77 trillion",
94
+ "gdpGrowth": 2.16,
95
+ "gdpPerCapita": 90027
95
96
  }
96
- ]
97
+ ],
98
+ "previousYear": 2024,
99
+ "changeDirection": "up",
100
+ "previousGdp": 29298013000000,
101
+ "gdpChange": 1471687000000,
102
+ "gdpChangePercent": 5.02,
103
+ "previousGdpGrowth": 2.79,
104
+ "growthTrend": "slowing",
105
+ "gdpPerCapitaChangePercent": 4.48,
106
+ "gdpCagr5y": 7.56,
107
+ "gdpCagr10y": 5.34,
108
+ "averageGrowth5y": 3.31
97
109
  },
98
110
  "code": 200
99
111
  }
@@ -10,7 +10,7 @@ module APIVerve
10
10
  #
11
11
  # @example Basic usage
12
12
  # client = APIVerve::Gdp::Client.new(api_key: "your_api_key")
13
- # response = client.execute({ country: "US", year: 2023 })
13
+ # response = client.execute({ country: "US", year: 2023, changes: true })
14
14
  # puts response
15
15
  #
16
16
  # @see https://apiverve.com/marketplace/gdp?utm_source=ruby&utm_medium=referral&utm_content=readme
@@ -19,7 +19,7 @@ module APIVerve
19
19
  DEFAULT_TIMEOUT = 30
20
20
 
21
21
  # Validation rules for parameters
22
- VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 3 }, 'year' => { type: 'integer', required: false, min: 1960, max: 2030 } }
22
+ VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 3 }, 'year' => { type: 'integer', required: false, min: 1960, max: 2030 }, 'changes' => { type: 'boolean', required: false } }
23
23
 
24
24
  # Format validation patterns
25
25
  FORMAT_PATTERNS = {
data/lib/apiverve_gdp.rb CHANGED
@@ -4,6 +4,6 @@ require_relative "apiverve_gdp/client"
4
4
 
5
5
  module APIVerve
6
6
  module Gdp
7
- VERSION = "1.2.4"
7
+ VERSION = "1.2.5"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiverve_gdp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIVerve
@@ -58,7 +58,10 @@ dependencies:
58
58
  - !ruby/object:Gem::Version
59
59
  version: '2.0'
60
60
  description: Get GDP (Gross Domestic Product) data for any country including current
61
- values and historical data going back to 1960.
61
+ values and historical data going back to 1960. With changes=true it also returns
62
+ the direction against the previous year, and on paid plans the prior year's GDP,
63
+ the dollar and percent change, whether real growth is accelerating or slowing, and
64
+ 5- and 10-year compound annual growth.
62
65
  email:
63
66
  - hello@apiverve.com
64
67
  executables: []