{"id":15406860,"url":"https://github.com/dannyben/intrinio","last_synced_at":"2025-08-22T08:11:38.376Z","repository":{"id":56877857,"uuid":"80372691","full_name":"DannyBen/intrinio","owner":"DannyBen","description":"Library and command line interface for Intrinio data API","archived":false,"fork":false,"pushed_at":"2025-08-01T15:30:48.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-17T19:31:12.666Z","etag":null,"topics":["api","api-client","command-line","economic-data","gem","intrinio","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DannyBen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-29T21:07:35.000Z","updated_at":"2025-08-01T15:30:51.000Z","dependencies_parsed_at":"2024-10-01T16:26:01.601Z","dependency_job_id":"8d205678-e0ae-4597-af62-b831f7066c8f","html_url":"https://github.com/DannyBen/intrinio","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.34545454545454546","last_synced_commit":"e4588b5c6d4a0bd71f8042cfef338eed170a2440"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/DannyBen/intrinio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fintrinio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fintrinio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fintrinio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fintrinio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/intrinio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fintrinio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606595,"owners_count":24788979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","command-line","economic-data","gem","intrinio","ruby"],"created_at":"2024-10-01T16:25:58.916Z","updated_at":"2025-08-22T08:11:38.367Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intrinio API Library and Command Line\n\nThis gem provides both a Ruby library and a command line interface for the \n[Intrinio][1] data service.\n\n---\n\n## Install\n\n```\n$ gem install intrinio\n```\n\nOr with bundler:\n\n```ruby\ngem 'intrinio'\n```\n\n\n## Features\n\n* Easy to use interface.\n* Use as a library or through the command line.\n* Access any Intrinio endpoint and option directly.\n* Display output as JSON or CSV.\n* Save output to a file as JSON or CSV.\n* Includes a built in file cache (disabled by default).\n\n## Usage\n\nFirst, require and initialize with your username and password.\n\n```ruby\nrequire 'intrinio'\nintrinio = Intrinio::API.new username: 'me', password: 'secret'\n# or: Intrinio::API.new auth: 'me:secret'\n```\n\nNow, you can access any Intrinio endpoint with any optional parameter, like\nthis:\n\n```ruby\nresult = intrinio.get \"indices\", type: 'economic', page_size: 5\n```\n\nIn addition, for convenience, you can use the first part of the endpoint as\na method name, like this:\n\n```ruby\nresult = intrinio.indices type: 'economic', page_size: 5\n```\n\nIn other words, these calls are the same:\n\n```ruby\nintrinio.get 'endpoint', param: value\nintrinio.endpoint, param: value\n```\n\nas well as these two:\n\n```ruby\nintrinio.get 'endpoint/sub', param: value\nintrinio.endpoint 'sub', param: value\n```\n\nBy default, you will get a ruby hash in return. If you wish to have more \ncontrol over the response, use the `get!` method instead:\n\n```ruby\npayload = intrinio.get! \"indices\", type: 'economic', page_size: 5 \n\n# Request Object\np payload.request.class\n# =\u003e HTTParty::Request\n\n# Response Object\np payload.response.class\n# =\u003e Net::HTTPOK\n\np payload.response.body\n# =\u003e JSON string\n\np payload.response.code\n# =\u003e 200\n\np payload.response.msg\n# =\u003e OK\n\n# Headers Object\np payload.headers\n# =\u003e Hash with headers\n\n# Parsed Response Object\np payload.parsed_response\n# =\u003e Hash with HTTParty parsed response \n#    (this is the content returned with #get)\n```\n\nYou can get the response as CSV by calling `get_csv`:\n\n```ruby\nresult = intrinio.get_csv \"indices\", page_size: 5\n# =\u003e CSV string\n```\n\nIntrinio automatically decides which part of the data to convert to CSV.\nWhen there is an array in the response, it will be used as the CSV data. \nOtherwise, the entire response will be treated as a single-row CSV.\n\nTo save the output directly to a file, use the `save` method:\n\n```ruby\nintrinio.save \"filename.json\", \"indices\", type: 'economic', page_size: 5\n```\n\nOr, to save CSV, use the `save_csv` method:\n\n```ruby\nintrinio.save_csv \"filename.csv\", \"indices\", page_size: 5\n```\n\n## Command Line\n\nThe command line utility `intrinio` acts in a similar way. To use your \nIntrinio authentication, simply set it in the environment variables \n`INTRINIO_AUTH`:\n\n`$ export INTRINIO_AUTH=username:password`\n\nThese commands are available:\n\n`$ intrinio get [--csv] PATH [PARAMS...]` - print the output.  \n`$ intrinio pretty PATH [PARAMS...]` - print a pretty JSON.  \n`$ intrinio see PATH [PARAMS...]` - print a colored output.  \n`$ intrinio url PATH [PARAMS...]` - show the constructed URL.  \n`$ intrinio save [--csv] FILE PATH [PARAMS...]` - save the output to a file.  \n\nRun `intrinio --help` for more information, or view the [full usage help][2].\n\nExamples:\n\n```shell\n# Shows the first 5 indices\n$ intrinio see indices page_size:5\n\n# Pass arguments that require spaces\n$ intrinio see indices \"query:interest rate\" page_size:5\n\n# Saves a file\n$ intrinio save --csv aapl.csv historical_data identifier:AAPL \\\n    item:adj_close_price frequency:monthly page_size:10\n\n# Shows the URL that Intrinio has constructed, good for debugging\n$ intrinio url indices query:interest page_size:5\n# =\u003e https://api.intrinio.com/indices?query=interest\u0026page_size=5\n\n```\n\n## Caching\n\nWe are using the [Lightly][3] gem for automatic HTTP caching.\nTo take the path of least surprises, caching is disabled by default.\n\nYou can enable and customize it by either passing options on \ninitialization, or by accessing the `Lightly` object directly at \na later stage.\n\n```ruby\nintrinio = Intrinio::API.new username: user, password: pass, \n  use_cache: true\n\nintrinio = Intrinio::API.new username: user, password: pass, \n  use_cache: true, cache_dir: 'tmp'\n\nintrinio = Intrinio::API.new username: user, password: pass, \n  use_cache: true, cache_life: 120\n\n# or \n\nintrinio = Intrinio::API.new username: user, password: pass\nintrinio.cache.enable\nintrinio.cache.dir = 'tmp/cache'   # Change cache folder\nintrinio.cache.life = 120          # Change cache life to 2 minutes\n```\n\nTo enable caching for the command line, simply set one or both of \nthese environment variables:\n\n```shell\n$ export INTRINIO_CACHE_DIR=cache   # default: 'cache'\n$ export INTRINIO_CACHE_LIFE=120    # default: 3600 (1 hour)\n$ intrinio get indices\n# =\u003e This call will be cached\n```\n\n\n[1]: https://www.intrinio.com\n[2]: https://github.com/DannyBen/intrinio/blob/master/lib/intrinio/docopt.txt\n[3]: https://github.com/DannyBen/lightly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fintrinio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Fintrinio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fintrinio/lists"}