Friends-themed Mock API (unofficial)

Sitcom evreninden karakterler, bölümler ve alıntılar. CRUD, Bearer kimlik doğrulaması, sayfalama, filtreleme ve her türlü hata kodunu uygulayın — kurulum gerekmez.

Temel URL: https://funapi.dev/api/friends/v1 · 14 uç nokta · OpenAPI 3.1 belgesi ve Postman koleksiyonu mevcut. Yeni misiniz? Önce şunu okuyun: başlangıç rehberi.

characters

altısı ve daha fazlası

episodes

on hayran favorisi

quotes

Bu API'den daha fazla alıntı yapılabilir miydi?

graphql

tek bir POST uç noktası, sorgu şeklinde

Friends API'si bir sitcom arşivini modelliyor: altı ana karakter, meslekleri ve sloganları, on bölüm ve bir alıntı koleksiyonu. Bu, kataloğun API sürümleme ile tanışması anlamına geliyor; v1 karakter listesi kasıtlı olarak kullanımdan kaldırılmış olarak işaretleniyor ve v2'ye işaret eden Deprecation, Sunset ve Link başlıklarıyla yanıt veriyor, böylece çoğu genel API'nin tüketicilerine sonunda dayattığı geçiş yolunu uygulayabilirsiniz.

Burada neler deneyebilirsin

Python ile eksiksiz bir CRUD yaşam döngüsünü test edin

requests'i kurun ve bu örneği canlı sandbox'a karşı çalıştırın. Herkese açık demo token yazmaya izin verir ve yeni bir sandbox kimliği örnek kaydı yalıtılmış tutar.

from uuid import uuid4
import requests

url = 'https://funapi.dev/api/friends/v1/characters'
headers = {'Authorization': 'Bearer qa-admin-token', 'X-Sandbox-ID': str(uuid4())}
created = requests.post(url, headers=headers, json={'name': 'Test character', 'job': 'tester'}, timeout=10)
assert created.status_code == 201
item_url = f"{url}/{created.json()['id']}"
read = requests.get(item_url, headers=headers, timeout=10)
assert read.status_code == 200 and read.json()['job'] == 'tester'
updated = requests.put(item_url, headers=headers, json={'job': 'engineer'}, timeout=10)
assert updated.status_code == 200 and updated.json()['job'] == 'engineer'
deleted = requests.delete(item_url, headers=headers, timeout=10)
assert deleted.status_code == 204 and not deleted.content
assert requests.get(item_url, headers=headers, timeout=10).status_code == 404
print('Create, read, update and delete passed')

Yalnızca sentetik veri kullanın. Her istekte aynı sandbox kimliğini tutun; her yeni çalıştırma ayrı bir sandbox oluşturur.

Örnek istek ve yanıt

GET https://funapi.dev/api/friends/v1/episodes — Bölümleri listele, sezona göre filtrele. Token yok, kayıt yok:

curl -i https://funapi.dev/api/friends/v1/episodes

Yanıt: 200 OK

{
  "total": 10,
  "data": [
    {
      "id": 1,
      "title": "The One Where Monica Gets a Roommate",
      "season": 1,
      "episode": 1,
      "rating": 8.3
    },
    {
      "id": 2,
      "title": "The One with the Prom Video",
      "season": 2,
      "episode": 14,
      "rating": 9.4
    },
    {
      "id": 3,
      "title": "The One Where No One's Ready",
      "season": 3,
      "episode": 2,
      "rating": 8.9
    },
    {
      "id": 4,
      "title": "The One with the Embryos",
      "season": 4,
      "episode": 12,
      "rating": 9.5
    },
    {
      "id": 5,
      "title": "The One with All the Thanksgivings",
      "season": 5,
      "episode": 8,
      "rating": 9.1
    },
    {
      "id": 6,
      "title": "The One with Ross's Sandwich",
      "season": 5,
      "episode": 9,
      "rating": 9
    },
    {
      "id": 7,
      "title": "The One Where Everybody Finds Out",
      "season": 5,
      "episode": 14,
      "rating": 9.7
    },
    {
      "id": 8,
      "title": "The One with the Cop",
      "season": 5,
      "episode": 16,

(Kısaltılmış hali — tam yanıt, çalıştırdığınızda geri gelir)

Bu endpoint'i aç ve çalıştır

55 mock REST API’nin tamamı

Bu yanıtı başka yerde kullan

Unofficial and fan-made. The Friends API is a practice API that borrows a theme; it is not affiliated with, sponsored or endorsed by the owners of the names it references, which belong to them. Every record it returns is test data for exercising HTTP behaviour, not an authoritative source on the subject.

Son güncelleme