Skip to content

Alamofire

A Swift library that makes HTTP network requests in apps simpler to write.

Stars
42.4k
Forks
7.6k
Licence
MIT
Language
Swift
Last update
5 days ago
Type
Library

What it is

Alamofire is an HTTP networking library written in Swift. It wraps Apple's URLSession so developers can send requests, encode parameters, upload and download files, validate responses, and handle authentication in a few lines of code. It is used by app developers who need to talk to web services from iOS, macOS and related Apple platforms.

  • Send a GET or POST request to a JSON API and decode the response into a Swift type
  • Upload files or multipart form data to a server with progress reporting
  • Download large files to disk, including resuming from saved data
  • Automatically retry failed requests or adapt requests such as adding auth headers
  • Inspect request timing metrics or print a cURL command for debugging

Great for

  • Swift developers building iOS or macOS apps that call web APIs
  • Teams who want built-in retry, authentication and response validation without writing that logic from scratch
  • Developers who want Swift concurrency (async/await) or Combine support for network calls
  • Projects that need certificate or public key pinning for secure connections

Not ideal for

  • Non-Swift projects, since it is a Swift library and the README does not describe bindings for other languages
  • Developers who want to use only Apple's URLSession directly with no extra layer
  • Projects that need full support on Linux or Windows, since the README lists those platforms as building but unsupported
Step-by-step guide: how to use AlamofireInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Xcode 16.0 or later (minimum Swift version 6.0) · Swift Package Manager, CocoaPods or Carthage

    Clone the repository

    git clone https://github.com/Alamofire/Alamofire.git
  2. 2

    Run it

    • Add Alamofire to your Xcode project through Swift Package Manager, CocoaPods or Carthage, as described in the README's Installation section
    • Import Alamofire in a Swift file
    • Call AF.request with a URL and chain the response handling you need
    • Run your app and check the response, or use debugPrint to see details
  3. 3

    Get the most out of it

    • Use the interceptor option to adapt and retry requests automatically
    • Use the cURL description hook to debug requests
    • Use Swift concurrency or Combine support depending on your code style
    • Read the Advanced Usage guide for custom sessions, routing and security settings
    • Consider the AlamofireImage and AlamofireNetworkActivityIndicator component libraries for related needs

Downloads

Strengths

  • Compact, chainable syntax that the README says can express retries and decoding in a few lines
  • Covers many common needs in one library, including uploads, downloads, pinning and reachability
  • MIT license and a large, established project with over 42,000 stars

Trade-offs

  • Only fully tested on Apple platforms; Linux, Windows and Android are listed as unsupported
  • Adds a dependency on top of URLSession, which some teams may prefer to avoid
  • Advanced features like custom sessions and interceptors have a learning curve

How it compares

ProjectStarsTypeLevelUpdatedBest for
Alamofire (this)42.4kLibraryintermediate5 days agoSwift developers building iOS or macOS apps that call web APIs
Moya15.4kLibraryintermediate4 months agoSwift developers building iOS or macOS apps that call web APIs
SwiftyJSON22.9kLibrarybeginner3 months agoSwift developers building iOS, macOS, tvOS or watchOS apps that read JSON from web APIs
Kingfisher24.4kLibrarybeginner4 days agoiOS or macOS developers who need to show remote images in lists or detail screens
IQKeyboardManager16.6kLibrarybeginner1 months agoiOS app developers building forms or screens with several text inputs
SwifterSwift15.3kLibrarybeginner4 days agoSwift developers building iOS or macOS apps who want common helper methods ready to use

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.