{"repo":"philnash/bitly","free":true,"listed":false,"github":"https://github.com/philnash/bitly","clone":"git clone https://github.com/philnash/bitly.git","description":"🗜 A Ruby wrapper for the bit.ly API","language":"Ruby","stars":449,"topics":["bitly","api-wrapper","api-client","shorten-urls","url-shortener","bitly-api","bitly-v4"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Bitly A Ruby gem for using the version 4 Bitly API to shorten links, expand short links and view metrics across users, links and organizations. Bitly Installation Usage Authentication Creating an API client Shorten a link Expand a link Available API Endpoints Groups Organizations Users Bitlinks QR codes Custom Bitlinks Campaigns BSDs (Branded Short Domains) Webhooks Customising HTTP requests Build your own adapter Development Contributing License Code of Conduct Installation Add this line to your application's Gemfile: And then execute: Or install it yourself as: Usage For a quick introduction, read this blog post on how to use the Bitly API in Ruby. Authentication All API endpoints require authentication with an OAuth token. You can get your own OAuth token from the Bitly console. Click on the account drop down menu, then Profile Settings then Generic Access Token . Fill in your password and you can generate an OAuth access token. For other methods to generate access tokens for users via OAuth flows, see the Authentication documentation. Once you have an access token you can use all the API methods. Creating an API client All API methods are available through the Bitly::API::Client . Initialise the client with the access token like so: You can then use the client to perform actions with the API Shorten a link With an authenticated client you can shorten a link like so: Expand a link With an authorised you can expand any Bitlink. Available API Endpoints This gem supports the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/philnash","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/philnash/bitly/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}