Company Lookup API - Ruby Gem
Company Lookup is a tool for retrieving metadata about SEC-registered public companies. Look up companies by ticker symbol, CIK number, company name, or SIC industry code. Returns company details including exchange, address, phone, and more.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_companylookup'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_companylookup
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_companylookup'
# Initialize the client
client = APIVerve::Companylookup::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ ticker: "AAPL" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ ticker: "AAPL" })
puts response["data"]
rescue APIVerve::Companylookup::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Companylookup::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Companylookup::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"ticker": "AAPL",
"cik": "0000320193",
"name": "Apple Inc.",
"tickers": [
"AAPL"
],
"exchanges": [
"Nasdaq"
],
"entityType": "operating",
"sic": "3571",
"sicDescription": "Electronic Computers",
"sector": "Manufacturing",
"category": "Large accelerated filer",
"stateOfIncorporation": "CA",
"fiscalYearEnd": "0928",
"ein": "942404110",
"phone": "408-996-1010",
"addresses": {
"mailing": {
"street1": "ONE APPLE PARK WAY",
"city": "CUPERTINO",
"stateOrCountry": "CA",
"zipCode": "95014"
},
"business": {
"street1": "ONE APPLE PARK WAY",
"city": "CUPERTINO",
"stateOrCountry": "CA",
"zipCode": "95014"
}
},
"formerNames": []
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/companylookup?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.