On this page
Overview
Faraday is a Ruby HTTP client library for calling APIs and web services. Beneath a common Connection API, applications can select an adapter such as Net::HTTP and compose middleware for authentication, JSON conversion, logging, and error handling. This keeps call-site structure more stable when transport implementations change.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Centralize connection settings and request-response processing
Faraday.new groups a base URL, headers, query parameters, timeouts, and proxy settings, then exposes HTTP verbs through one Connection. Middleware can add authorization headers, encode and parse JSON, raise on 4xx and 5xx responses, and log traffic in an ordered stack.
Best fit
Fits Ruby applications that need consistent policy across external APIs
It fits API clients, gems, and web applications that want service-specific connection and error policy in one place. It is also useful when switching from the default Net::HTTP transport or reusing middleware across several APIs.
Before adoption
Pin Ruby, extra gems, and middleware order, then test failure behavior
Version 2.14.4 requires Ruby 3.0 or newer. Net::HTTP is the default adapter shipped through Faraday's dependencies, while other adapters are separate gems. Identify which features live in core versus external gems and pin compatible versions.
Middleware selection and order change request and response behavior. Test timeouts, retries, JSON parsing, 4xx and 5xx handling, and redaction of sensitive headers against the real API. Changing the global default Connection can also affect unrelated callers.
Official sources
- [1]Faraday v2.14.4 README(2026-10-04)
- [2]Faraday v2.14.4 Quick Start(2026-10-04)
- [3]Faraday v2.14.4 configuration(2026-10-04)
- [4]Faraday v2.14.4 gemspec(2026-10-04)
- [5]Faraday v2.14.4 release(2026-10-04)
Supplemental curator note
The key comparison point is centralizing authentication, JSON conversion, retries, logging, and other HTTP behavior instead of scattering it across API clients. Some adapters and middleware are separate gems, so review the required components and their maintenance status individually.
Try it in 3 steps
- 1
Add the pinned gem to a Gemfile
Install Faraday 2.14.4 in an empty demo directory. Ruby 3.0 or newer and Bundler are required.
mkdir -p faraday-demo && cd faraday-demo && printf "source 'https://rubygems.org'\ngem 'faraday', '2.14.4'\n" > Gemfile && bundle install - 2
Create a small GET request
Create a request to the public test service used by the official Quick Start and print only the status and content type. Continue in the same terminal from step 1; the current directory is faraday-demo.
printf "require 'faraday'\nresponse = Faraday.get('https://httpbingo.org/get')\nputs [response.status, response.headers['content-type']].join(' ')\n" > request.rb - 3
Run it through Bundler
From the same faraday-demo directory used in step 2, run with the pinned dependency set. Real clients should add timeouts, error policy, and secure authentication handling to a Connection.
bundle exec ruby request.rb
Growth
Growth trends · Last 30 days
5,951 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 5
- Open PRs
- 29
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Alamofire42,406 Stars
2 shared tag(s) · 2 shared category(s)
build Swift HTTP networking on URLSession with concise requests, retries, uploads, downloads, and TLS pinning
Swift - Actix Web24,853 Stars
2 shared tag(s) · 2 shared category(s)
build high-performance HTTP APIs and WebSocket services in Rust on the Tokio async ecosystem
Rust - RestSharp9,818 Stars
2 shared tag(s) · 2 shared category(s)
Build REST and HTTP requests in .NET and map responses to C# types
C# - Apache HttpClient1,535 Stars
2 shared tag(s) · 2 shared category(s)
build Java HTTP/1.1 and HTTP/2 clients with connection management, authentication, cookies, and caching
Java - Spree Commerce15,739 Stars
2 shared tag(s) · 1 shared category(s) · Same language
self-host DTC, B2B, and marketplace commerce through REST APIs, SDKs, and modular storefronts
Ruby - graphql-ruby5,444 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Define typed GraphQL APIs in Ruby or Rails and execute client queries
Ruby
Report incorrect information
Tell us if any listing information is incorrect or outdated.