apiverve_jobsearch 1.2.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7823e237e0d875ed29edb89aac3f9dbde8735d9ae52c2946fb1584fc448a8e57
4
+ data.tar.gz: 4df61eb6f1c7b05169dffc05683d39a25045019e9c1419ff0d1b26a7690abfee
5
+ SHA512:
6
+ metadata.gz: 7a07baf5e5ed1bac801be02e7fde7088d6b39618d372167c67c2ff4cf82fa88cf79c88151465eec952fd41cb8096fc8144cec5e5499a4a17d374daa97ae5c100
7
+ data.tar.gz: 83d2091e2931c6f933520475056c661089abe0d3b556dc4788e72d4c4fad927c4d137929a7bbe52c80526f2b8953bdad40b15389da14908e11cfc8021f0563b6
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 APIVerve and EvlarSoft LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # Job Search API - Ruby Gem
2
+
3
+ Job Search is a jobs API that searches the open positions at thousands of companies at once. Search by job title keywords, location, country, remote work, employment type, posting date or company, and get the newest matching jobs first, each with its title, company, location, country, workplace type, posting date and apply link. Paid plans add salary ranges, a minimum salary filter, larger pages and each job's full description.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'apiverve_jobsearch'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```bash
16
+ $ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```bash
22
+ $ gem install apiverve_jobsearch
23
+ ```
24
+
25
+ ## Getting Started
26
+
27
+ Get your API key at [APIVerve](https://apiverve.com)
28
+
29
+ ### Basic Usage
30
+
31
+ ```ruby
32
+ require 'apiverve_jobsearch'
33
+
34
+ # Initialize the client
35
+ client = APIVerve::Jobsearch::Client.new(api_key: "YOUR_API_KEY")
36
+
37
+ # Make a request
38
+ response = client.execute({
39
+ keyword: "software engineer",
40
+ location: "New York",
41
+ country: "US",
42
+ remote: true,
43
+ employmentType: "full-time",
44
+ postedSince: "7d",
45
+ company: "airbnb",
46
+ minSalary: 100000,
47
+ page: 1
48
+ })
49
+
50
+ # Print the response
51
+ puts response
52
+ ```
53
+
54
+
55
+ ### Error Handling
56
+
57
+ ```ruby
58
+ begin
59
+ response = client.execute({ keyword: "software engineer", location: "New York", country: "US", remote: true, employmentType: "full-time", postedSince: "7d", company: "airbnb", minSalary: 100000, page: 1 })
60
+ puts response["data"]
61
+ rescue APIVerve::Jobsearch::ValidationError => e
62
+ puts "Validation error: #{e.errors.join(', ')}"
63
+ rescue APIVerve::Jobsearch::APIError => e
64
+ puts "API error: #{e.message}"
65
+ puts "Status code: #{e.status_code}"
66
+ end
67
+ ```
68
+
69
+ ### Debug Mode
70
+
71
+ ```ruby
72
+ # Enable debug logging
73
+ client = APIVerve::Jobsearch::Client.new(
74
+ api_key: "YOUR_API_KEY",
75
+ debug: true
76
+ )
77
+ ```
78
+
79
+ ## Example Response
80
+
81
+ ```json
82
+ {
83
+ "status": "ok",
84
+ "error": null,
85
+ "data": {
86
+ "page": 1,
87
+ "count": 2,
88
+ "hasMore": true,
89
+ "jobs": [
90
+ {
91
+ "id": "b4f50cb0115efeef41cb",
92
+ "title": "Senior Network and Cloud Engineer",
93
+ "company": "Acturis",
94
+ "location": "London, England, United Kingdom",
95
+ "locations": [
96
+ "London, England, United Kingdom"
97
+ ],
98
+ "country": "GB",
99
+ "remote": false,
100
+ "workplaceType": "hybrid",
101
+ "employmentType": "full-time",
102
+ "postedAt": "2026-10-14T15:37:26.000Z",
103
+ "url": "https://careers.acturis.com/o/senior-network-and-cloud-engineer",
104
+ "applyUrl": "https://careers.acturis.com/o/senior-network-and-cloud-engineer/c/new",
105
+ "salary": {
106
+ "min": null,
107
+ "max": null,
108
+ "currency": null,
109
+ "interval": null
110
+ }
111
+ },
112
+ {
113
+ "id": "43175a4af41a8c5a9a3b",
114
+ "title": "Senior AI Engineer in Computer Vision",
115
+ "company": "Faktion BV",
116
+ "location": "Antwerp, Vlaams Gewest, Belgium",
117
+ "locations": [
118
+ "Antwerp, Vlaams Gewest, Belgium"
119
+ ],
120
+ "country": "BE",
121
+ "remote": false,
122
+ "workplaceType": "hybrid",
123
+ "employmentType": "full-time",
124
+ "postedAt": "2026-08-24T13:17:35.000Z",
125
+ "url": "https://talent.faktion.com/o/senior-ai-engineer-in-computer-vision",
126
+ "applyUrl": "https://talent.faktion.com/o/senior-ai-engineer-in-computer-vision/c/new",
127
+ "salary": {
128
+ "min": null,
129
+ "max": null,
130
+ "currency": null,
131
+ "interval": null
132
+ }
133
+ }
134
+ ]
135
+ }
136
+ }
137
+ ```
138
+
139
+ ## Documentation
140
+
141
+ For more information, visit the [API Documentation](https://docs.apiverve.com/ref/jobsearch?utm_source=rubygems&utm_medium=referral&utm_content=readme).
142
+
143
+ ## Support
144
+
145
+ - Website: [https://apiverve.com/marketplace/jobsearch?utm_source=ruby&utm_medium=referral&utm_content=readme](https://apiverve.com/marketplace/jobsearch?utm_source=ruby&utm_medium=referral&utm_content=readme)
146
+ - Email: hello@apiverve.com
147
+
148
+ ## License
149
+
150
+ This gem is available under the [MIT License](LICENSE).
@@ -0,0 +1,184 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faraday"
4
+ require "faraday/multipart"
5
+ require "json"
6
+
7
+ module APIVerve
8
+ module Jobsearch
9
+ # Client for the Job Search API
10
+ #
11
+ # @example Basic usage
12
+ # client = APIVerve::Jobsearch::Client.new(api_key: "your_api_key")
13
+ # response = client.execute({ keyword: "software engineer", location: "New York", country: "US", remote: true, employmentType: "full-time", postedSince: "7d", company: "airbnb", minSalary: 100000, page: 1 })
14
+ # puts response
15
+ #
16
+ # @see https://apiverve.com/marketplace/jobsearch?utm_source=ruby&utm_medium=referral&utm_content=readme
17
+ class Client
18
+ BASE_URL = "https://api.apiverve.com/v1/jobsearch"
19
+ DEFAULT_TIMEOUT = 30
20
+
21
+ # Validation rules for parameters
22
+ VALIDATION_RULES = { 'keyword' => { type: 'string', required: true, max_length: 100 }, 'location' => { type: 'string', required: false, max_length: 100 }, 'country' => { type: 'string', required: false, max_length: 60 }, 'remote' => { type: 'boolean', required: false }, 'employmentType' => { type: 'string', required: false }, 'postedSince' => { type: 'string', required: false, max_length: 30 }, 'company' => { type: 'string', required: false, max_length: 100 }, 'minSalary' => { type: 'number', required: false, min: 0 }, 'page' => { type: 'integer', required: false, min: 1, max: 10 } }
23
+
24
+ # Format validation patterns
25
+ FORMAT_PATTERNS = {
26
+ 'email' => /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
27
+ 'url' => /^https?:\/\/.+/,
28
+ 'ip' => /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,
29
+ 'date' => /^\d{4}-\d{2}-\d{2}$/,
30
+ 'hexColor' => /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/
31
+ }.freeze
32
+
33
+ # Initialize the client
34
+ #
35
+ # @param api_key [String] Your APIVerve API key
36
+ # @param timeout [Integer] Request timeout in seconds (default: 30)
37
+ # @param debug [Boolean] Enable debug logging (default: false)
38
+ # @raise [ArgumentError] If API key is invalid
39
+ def initialize(api_key:, timeout: DEFAULT_TIMEOUT, debug: false)
40
+ validate_api_key!(api_key)
41
+
42
+ @api_key = api_key
43
+ @timeout = timeout
44
+ @debug = debug
45
+
46
+ @connection = Faraday.new(url: BASE_URL) do |conn|
47
+ conn.request :multipart
48
+ conn.request :url_encoded
49
+ conn.adapter Faraday.default_adapter
50
+ conn.options.timeout = @timeout
51
+ conn.headers["x-api-key"] = @api_key
52
+ conn.headers["auth-mode"] = "rubygems-package"
53
+ conn.headers["Content-Type"] = "application/json"
54
+ end
55
+ end
56
+
57
+ # Execute the API request
58
+ #
59
+ # @param params [Hash] Query parameters or request body
60
+ # @return [Hash] API response
61
+ # @raise [APIError] If the request fails
62
+ # @raise [ValidationError] If parameter validation fails
63
+ def execute(params = {})
64
+ validate_params!(params)
65
+
66
+ log("Making GET request to #{BASE_URL}")
67
+ log("Parameters: #{params.inspect}") if params.any?
68
+
69
+ response = @connection.get do |req|
70
+ params.each { |k, v| req.params[k.to_s] = v }
71
+ end
72
+
73
+ handle_response(response)
74
+ end
75
+
76
+ private
77
+
78
+ def validate_api_key!(api_key)
79
+ raise ArgumentError, "API key is required. Get your API key at: https://apiverve.com" if api_key.nil? || api_key.strip.empty?
80
+
81
+ unless api_key.match?(/^[a-zA-Z0-9_-]+$/)
82
+ raise ArgumentError, "Invalid API key format. API key should only contain letters, numbers, hyphens, and underscores."
83
+ end
84
+ end
85
+
86
+ def validate_params!(params)
87
+ return if VALIDATION_RULES.empty?
88
+
89
+ errors = []
90
+
91
+ VALIDATION_RULES.each do |param_name, rules|
92
+ value = params[param_name.to_sym] || params[param_name]
93
+
94
+ # Check required
95
+ if rules[:required] && (value.nil? || value.to_s.empty?)
96
+ errors << "Required parameter [#{param_name}] is missing."
97
+ next
98
+ end
99
+
100
+ next if value.nil?
101
+
102
+ case rules[:type]
103
+ when "integer", "number"
104
+ begin
105
+ num_value = rules[:type] == "number" ? Float(value) : Integer(value)
106
+ errors << "Parameter [#{param_name}] must be at least #{rules[:min]}." if rules[:min] && num_value < rules[:min]
107
+ errors << "Parameter [#{param_name}] must be at most #{rules[:max]}." if rules[:max] && num_value > rules[:max]
108
+ rescue ArgumentError, TypeError
109
+ errors << "Parameter [#{param_name}] must be a valid #{rules[:type]}."
110
+ end
111
+ when "string"
112
+ unless value.is_a?(String)
113
+ errors << "Parameter [#{param_name}] must be a string."
114
+ next
115
+ end
116
+ errors << "Parameter [#{param_name}] must be at least #{rules[:min_length]} characters." if rules[:min_length] && value.length < rules[:min_length]
117
+ errors << "Parameter [#{param_name}] must be at most #{rules[:max_length]} characters." if rules[:max_length] && value.length > rules[:max_length]
118
+
119
+ if rules[:format] && FORMAT_PATTERNS[rules[:format]]
120
+ unless value.match?(FORMAT_PATTERNS[rules[:format]])
121
+ errors << "Parameter [#{param_name}] must be a valid #{rules[:format]}."
122
+ end
123
+ end
124
+ when "boolean"
125
+ unless [true, false, "true", "false"].include?(value)
126
+ errors << "Parameter [#{param_name}] must be a boolean."
127
+ end
128
+ end
129
+
130
+ # Enum validation
131
+ if rules[:enum] && !rules[:enum].include?(value)
132
+ errors << "Parameter [#{param_name}] must be one of: #{rules[:enum].join(', ')}."
133
+ end
134
+ end
135
+
136
+ raise ValidationError, errors unless errors.empty?
137
+ end
138
+
139
+ def handle_response(response)
140
+ log("Response status: #{response.status}")
141
+
142
+ data = JSON.parse(response.body)
143
+
144
+ if data["status"] == "error"
145
+ raise APIError.new(data["error"] || "Unknown API error", response.status, data)
146
+ end
147
+
148
+ unless response.success?
149
+ raise APIError.new(data["error"] || "HTTP #{response.status} error", response.status, data)
150
+ end
151
+
152
+ log("Request successful")
153
+ data
154
+ rescue JSON::ParserError => e
155
+ raise APIError.new("Invalid JSON response: #{e.message}", response.status)
156
+ end
157
+
158
+ def log(message)
159
+ puts "[APIVerve::Jobsearch] #{message}" if @debug
160
+ end
161
+ end
162
+
163
+ # Custom error class for API errors
164
+ class APIError < StandardError
165
+ attr_reader :status_code, :response
166
+
167
+ def initialize(message, status_code = nil, response = nil)
168
+ @status_code = status_code
169
+ @response = response
170
+ super(message)
171
+ end
172
+ end
173
+
174
+ # Custom error class for validation errors
175
+ class ValidationError < StandardError
176
+ attr_reader :errors
177
+
178
+ def initialize(errors)
179
+ @errors = errors
180
+ super("Validation failed: #{errors.join(' ')}")
181
+ end
182
+ end
183
+ end
184
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "apiverve_jobsearch/client"
4
+
5
+ module APIVerve
6
+ module Jobsearch
7
+ VERSION = "1.2.2"
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apiverve_jobsearch
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.2
5
+ platform: ruby
6
+ authors:
7
+ - APIVerve
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-10-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: faraday-multipart
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: json
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
61
+ description: Job Search is a jobs API that searches the open positions at thousands
62
+ of companies at once. Search by job title keywords, location, country, remote work,
63
+ employment type, posting date or company, and get the newest matching jobs first,
64
+ each with its title, company, location, country, workplace type, posting date and
65
+ apply link. Paid plans add salary ranges, a minimum salary filter, larger pages
66
+ and each job's full description.
67
+ email:
68
+ - hello@apiverve.com
69
+ executables: []
70
+ extensions: []
71
+ extra_rdoc_files: []
72
+ files:
73
+ - LICENSE
74
+ - README.md
75
+ - lib/apiverve_jobsearch.rb
76
+ - lib/apiverve_jobsearch/client.rb
77
+ homepage: https://apiverve.com/marketplace/jobsearch?utm_source=ruby&utm_medium=referral&utm_content=homepage
78
+ licenses:
79
+ - MIT
80
+ metadata:
81
+ homepage_uri: https://apiverve.com/marketplace/jobsearch?utm_source=ruby&utm_medium=referral&utm_content=homepage
82
+ source_code_uri: https://github.com/apiverve/jobsearch-API/tree/main/ruby
83
+ changelog_uri: https://apiverve.com/changelog
84
+ documentation_uri: https://docs.apiverve.com/ref/jobsearch
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: 2.7.0
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubygems_version: 3.0.3.1
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Job Search API - Ruby Client
104
+ test_files: []