# reactiveui/refit

The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.

Repository: https://github.com/reactiveui/refit
Canonical: https://ross.abutalabs.com/products/refit
Homepage: https://reactiveui.github.io/refit/
Language: C#
License: MIT
License Family: permissive
Topics: dotnet, dotnet-core, http, xamarin, c-sharp, json, xml
Last push: 2026-08-25T12:11:16+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 98, longevity 100
- inputs: {"age_days": 4790, "days_push": 8, "days_rel": 15, "gap_med": 6, "n_releases_24m": 20}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9561, forks 787 (observed 2026-08-28T04:10:31.953174+00:00)

## What it is
Refit is a type-safe REST client library for .NET that turns REST APIs into live C# interfaces, generating HttpClient-based implementations automatically. Inspired by Square's Retrofit, it supports JSON/XML serialization, HttpClientFactory integration, and declarative client testing.

## Use cases
- call a REST API from C# with type-safe interfaces
- avoid writing boilerplate HttpClient code in .NET
- integrate API clients with HttpClientFactory and dependency injection
- consume JSON or XML web services in Xamarin or .NET MAUI apps
- unit test generated API clients with stubbed responses

## When to choose
- you want Retrofit-style declarative REST clients in .NET
- you prefer interface-based API definitions over manual HttpClient calls
- you need a mature, widely used HTTP client library for .NET Core, Xamarin, or modern .NET

## When to avoid
- you need fine-grained manual control over every HTTP request
- your project is not on the .NET platform
- you need GraphQL or gRPC rather than REST

## Facets
- artifact type: library
- maturity: active
- function: http-client, serialization, api-framework
- domain: web-development, apis, developer-tools, cross-platform
- platform: dotnet, cross-platform
- tags: rest-client, retrofit-inspired, type-safe, httpclientfactory, xamarin, source-generation, c-sharp, mobile

## Member repositories
- reactiveui/refit (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:31.953174+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:21:56.971496+00:00, confidence not recorded.
  - readme: https://github.com/reactiveui/refit (fetched 2026-08-28T04:10:31.953174+00:00, sha c0c89e9a85eb)
  - homepage: https://reactiveui.github.io/refit/ (fetched 2026-08-29T08:21:32.237553+00:00, sha 331aa44aa58a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
