{"id":15590768,"url":"https://github.com/timrogers/starling-ruby","last_synced_at":"2025-08-30T17:30:43.546Z","repository":{"id":48776886,"uuid":"92720748","full_name":"timrogers/starling-ruby","owner":"timrogers","description":"A Ruby library for accessing the Starling Bank (https://www.starlingbank.com) API","archived":false,"fork":false,"pushed_at":"2023-04-18T13:28:00.000Z","size":161,"stargazers_count":10,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T17:12:22.558Z","etag":null,"topics":[],"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/timrogers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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-05-29T08:26:31.000Z","updated_at":"2024-01-14T14:57:21.000Z","dependencies_parsed_at":"2024-10-02T23:28:57.323Z","dependency_job_id":"b03924ee-2f05-428b-83a5-cda88f8cc05b","html_url":"https://github.com/timrogers/starling-ruby","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":"0.44047619047619047","last_synced_commit":"771edde06a46c96715e00799009882d4aaa1cd64"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/timrogers/starling-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fstarling-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fstarling-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fstarling-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fstarling-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timrogers","download_url":"https://codeload.github.com/timrogers/starling-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Fstarling-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272880982,"owners_count":25008930,"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-30T02:00:09.474Z","response_time":77,"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":[],"created_at":"2024-10-02T23:28:55.367Z","updated_at":"2025-08-30T17:30:43.267Z","avatar_url":"https://github.com/timrogers.png","language":"Ruby","readme":"# Starling Ruby Library\n\nThe Starling Ruby library provides a simple, idiomatic interface to the\n[Starling Bank API](https://developer.starlingbank.com) compatible with Ruby 2.4, Ruby\n2.3 and Ruby 2.2. JRuby is also generally supported, but is currently not tested due to\nCI limitations.\n\n[![CircleCI](https://circleci.com/gh/timrogers/starling-ruby/tree/master.svg?style=svg)](https://circleci.com/gh/timrogers/starling-ruby/tree/master)\n[![Gem Version](https://badge.fury.io/rb/starling-ruby.svg)](https://badge.fury.io/rb/starling-ruby)\n\n## Getting started\n\nInstall the gem by adding it to your Gemfile, and then run `bundle`:\n\n```ruby\ngem 'starling-ruby', '~\u003e 0.2.0', require: 'starling'\n```\n\nYou'll need to get a personal access token for your Starling account. To get set up,\nhead to the Starling Developers \n[\"Get Started\" page](https://developer.starlingbank.com/get-started) and then scroll\ndown to the \"Personal Access\" section for instructions.\n\nAt the moment, the library is not designed to\nsupport OAuth applications (it can't handle refreshing access tokens) or endpoints\nrequiring the [`pay-local:create` scope](https://developer.starlingbank.com/tiers),\nwhich is not granted to personal access tokens.\n\nYou can now initialise the client, providing your access token, and optionally an\nenvironment (either `:sandbox` or `:production`, defaulting to :production):\n\n```ruby\nstarling = Starling::Client.new(\n  access_token: ENV['STARLING_ACCESS_TOKEN'],\n  # Omit the line below to use the default production environment\n  environment: :sandbox,\n)\n```\n\n## Usage\n\nNow you've initialised a `Starling::Client` with your access token, you can start making\nrequests to the API. \n\nAll APIs are supported except \"Get Photo\" under the Contact API (it doesn't seem to\nactually be possible to set a photo...) and the Payment APIs for creating an immediate or\nscheduled payment (which are not supported for personal access tokens).\n\nSee below for a few simple examples, or head to our\n[full documentation](http://www.rubydoc.info/github/timrogers/starling-ruby/master) for\ncomplete details:\n\n### Check your balance\n\n```ruby\nbalance = starling.account_balance.get\nputs \"Your balance is #{balance.amount} #{balance.currency}!\"\n```\n\n### Fetch information about your account\n\n```ruby\naccount = starling.account.get\nputs \"Your sort code is #{account.sort_code} and your account number is \" \\\n     \"#{account.number}.\"\n```\n\n### List transactions\n\n```ruby\ntransaction = starling.transactions.list.first\nputs \"Your most recent transaction was for #{transaction.amount} on \" \\\n     \"#{transaction.created}\"\n```\n\n### Fetch a transaction by ID\n\n```ruby\ntransaction = starling.transactions.get(\"insert-uuid-here\")\nputs \"Your transaction was for #{transaction.amount} on #{transaction.created}\"\n```\n\n### Fetch a merchant by ID\n\n```ruby\nmerchant = starling.merchants.get(\"insert-uuid-here\")\nputs \"You can call #{merchant.name} on #{merchant.phone_number}\"\n```\n\n### Fetch a merchant location by ID\n\n```ruby\nmerchant_location = starling.merchant_locations.get(\n  \"insert-merchant-uid-here\",\n  \"insert-merchant-location-uid-here\"\n)\n\nputs \"This location for #{merchant_location.merchant_name} is called \" \\\n     \"#{merchant_location.location_name}\"\n```\n\n## Examples\n\nHere, we'll keep a list of applications using the library for reference and inspiration:\n\n* __[Starling Terminal](https://github.com/timrogers/starling-terminal)__ - a tool that\nlets you view your Starling Bank statement right from your terminal\n\n## Philosophy\n\nOnce you've initialised a `Starling::Client`, it exposes a number of services (living\nin `lib/starling/services`) which have methods calling out to the API. \n\nPhilosophically, these services represent \"kinds of things\" (i.e. resources) returned by \nor manipulated by the API. __These do not necessarily match up with the APIs listed in\nStarling's [documentation](https://developer.starlingbank.com/docs), which is grouped\nslightly differently__. \n\nThe benefit is that we can have a small, predictable set of methods in our\nservices exposing API endpoints: `#get`, `#list`, `#create` and `#delete`. \n\nThis is best shown through an example - let's look at the Merchant API. It has two\nendpoints listed under it: \"Get Merchant\" and \"Get Location\". The former operates on\na \"kind of thing\" called a \"contact\", and the latter operates on a \"kind of thing\" called\na \"contact account\". You could potentially group these together, but then you'd have to\nhave a slightly odd method name (something like `get_location`). Instead, we keep things\nconsistent, like follows:\n\n```ruby\nstarling.merchants.get(merchant_id)\nstarling.merchant_locations.get(merchant_id, merchant_location_id)\n```\n\nOther parts of the Starling Bank API exhibit similar difficulties - for example, the\nContact API operates on Contacts, Contact Accounts and Contact Photos.\n\nMethods on the services for accessing the API return resources (found in\n`lib/starling/resources`), arrays of resources or, rarely, `Faraday::Response`s in the\ncase of `DELETE` requests.\n\n## Backwards compatability\n\nThis gem is versioned using [Semantic Versioning](http://semver.org/), so you can be\nconfident when updating that there will not be breaking changes outside of a major\nversion (following format MAJOR.MINOR.PATCH, so for instance moving from 2.3.0 to 3.0.0\nwould be allowed to include incompatible API changes). See\n[CHANGELOG.md](https://github.com/timrogers/starling-ruby/tree/master/CHANGELOG.md) for\ndetails on what has changed in each version.\n\nUntil we reach v1.0, minor versions may contain backwards-incompatible changes, as the\nAPI stabilises. Any such changes will be flagged in the changelog.\n\n## Tests\n\nThe library must pass code checks by RSpec, Rubocop and Reek:\n\n* `bundle exec rspec spec`: checks the library against automated tests we've written\n* `bundle exec rubocop`: checks the code against established Ruby code style\n* `bundle exec reek lib`: checks the code for \"code smells\"\n\nAs part of our continuous integration (CI) process, we run RSpec, Rubocop and Reek in\nCircleCI on Ruby 2.4, Ruby 2.3 and Ruby 2.2. Feel free to push up your branch and open\na pull request to have Circle test your code.\n\n## Contributing\n\nAll contributions are welcome - just make a pull request, making sure you include tests\nand documentation for any public methods, and write a good, informative commit\nmessage/pull request body.\n\nCheck out\n[CODE_OF_CONDUCT.md](https://github.com/timrogers/starling-ruby/blob/master/CODE_OF_CONDUCT.md)\nto learn about how we can best work together as an open source community to make the\nStarling Ruby library as good as it can be.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Fstarling-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimrogers%2Fstarling-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Fstarling-ruby/lists"}