Repolode
lysine-dev

lysine-dev/retrofit

A type-safe HTTP client for Android and Java that turns annotated interface methods into network calls.

Stars
43,934
Forks
7,331
Open issues
148
Last commit
10 hours ago

What is it?

Retrofit is an HTTP client for Android and Java. You declare your API as a Java interface with annotated methods, and Retrofit generates the implementation that performs the HTTP requests, so calls are checked by the compiler rather than built from strings.

The library requires Java 8 or later, or Android API 21 or later. It is distributed through Maven Central under the coordinates com.squareup.retrofit2:retrofit. ProGuard and R8 shrinking rules are covered: R8 includes them automatically, while ProGuard users add them manually. OkHttp is a dependency and is used as the underlying transport.

Key features

  • 01Declare HTTP endpoints as annotated Java interface methods.
  • 02Generates the request implementation automatically at runtime.
  • 03Built on OkHttp as the underlying HTTP transport.
  • 04Ships R8 shrinking and obfuscation rules, with a ProGuard configuration file.

Use cases

  • Calling a REST API from an Android app with compile-time checked method signatures.
  • Building a typed client for a JVM service that consumes a JSON web API.

Quick start

  1. 1

    Add the dependency com.squareup.retrofit2:retrofit:3.0.0 from Maven Central

  2. 2

    Check that your environment meets the requirement of Java 8+ or Android API 21+

Things to know

  • Requires Java 8+ or Android API 21+.
  • ProGuard users must add the Retrofit rules manually.

Topics

FAQ

What is retrofit?
A type-safe HTTP client for Android and Java that turns annotated interface methods into network calls. Retrofit is an HTTP client for Android and Java. You declare your API as a Java interface with annotated methods, and Retrofit generates the implementation that performs the HTTP requests, so calls are checked by the compiler rather than built from strings.
Is retrofit free to use? What license does it have?
retrofit is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is retrofit still maintained?
Actively maintained. The last commit to retrofit was on Oct 20, 2026.
What can I use retrofit for?
Calling a REST API from an Android app with compile-time checked method signatures. Building a typed client for a JVM service that consumes a JSON web API.
How do I install retrofit?
Add the dependency com.squareup.retrofit2:retrofit:3.0.0 from Maven Central Check that your environment meets the requirement of Java 8+ or Android API 21+
Where can I get retrofit?
The source code and installation instructions are on GitHub: https://github.com/lysine-dev/retrofit

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects