Instagram Scraper API

Instagram profil verilerini çekmek için REST API

Authentication
Tüm istekler X-API-Key header'ı ile doğrulanır.
X-API-Key: your-secret-api-key
Endpoints
GET /health
API durumunu kontrol eder.
Request
curl -X GET http://localhost:3000/health \
  -H "X-API-Key: your-api-key"
Response
{
  "status": "ok",
  "timestamp": "2025-11-18T22:00:00.000Z"
}
GET /api/scrape/:username
Instagram kullanıcı profili, takipçi/takip edilen listesi ve gönderilerini çeker.
Path Parameters
username string · required · path
Instagram kullanıcı adı
Query Parameters (Tümü Opsiyonel)
maxFollowers number · optional · query
Maksimum takipçi sayısı (null = hepsi). Örnek: 50
maxFollowing number · optional · query
Maksimum takip edilen sayısı (null = hepsi). Örnek: 100
maxPosts number · optional · query
Maksimum post sayısı. Varsayılan: 12
includeFollowers boolean · optional · query
Takipçi listesini çek. Varsayılan: true
includeFollowing boolean · optional · query
Takip edilen listesini çek. Varsayılan: true
includePosts boolean · optional · query
Post listesini çek. Varsayılan: true
includeStories boolean · optional · query
Story'leri çek. Varsayılan: true
Headers
X-API-Key string · required · header
API erişim anahtarı
Request Examples
# Temel kullanım (tüm veriler)
curl -X GET "http://localhost:3000/api/scrape/instagram" \
  -H "X-API-Key: your-api-key"

# Sadece profil bilgisi (listeler olmadan)
curl -X GET "http://localhost:3000/api/scrape/instagram?includeFollowers=false&includeFollowing=false&includePosts=false" \
  -H "X-API-Key: your-api-key"

# İlk 50 takipçi ve 50 takip edilen
curl -X GET "http://localhost:3000/api/scrape/instagram?maxFollowers=50&maxFollowing=50&includePosts=false" \
  -H "X-API-Key: your-api-key"

# Sadece 20 post detayı
curl -X GET "http://localhost:3000/api/scrape/instagram?maxPosts=20&includeFollowers=false&includeFollowing=false" \
  -H "X-API-Key: your-api-key"

# Sadece story'leri çek
curl -X GET "http://localhost:3000/api/scrape/instagram?includeFollowers=false&includeFollowing=false&includePosts=false" \
  -H "X-API-Key: your-api-key"
Response 200
{
  "success": true,
  "data": {
    "username": "instagram",
    "fullName": "Instagram",
    "bio": "Bio text",
    "profilePicUrl": "https://...",
    "isVerified": true,
    "isPrivate": false,
    "externalUrl": "https://...",
    "stats": {
      "postsCount": 1234,
      "followersCount": 500000000,
      "followingCount": 123
    },
    "hasStory": true,
    "stories": [
      {
        "type": "image",
        "url": "https://...",
        "thumbnail": "https://..."
      },
      {
        "type": "video",
        "url": "https://...",
        "thumbnail": "https://..."
      }
    ],
    "followers": [
      {
        "username": "user1",
        "fullName": "User One",
        "profileUrl": "https://instagram.com/user1"
      }
    ],
    "following": [
      {
        "username": "user2",
        "fullName": "User Two",
        "profileUrl": "https://instagram.com/user2"
      }
    ],
    "posts": [
      {
        "postUrl": "https://instagram.com/p/ABC123/",
        "thumbnail": "https://...",
        "alt": "Photo description",
        "likes": 1250,
        "comments": 45,
        "caption": "Check out this post! #instagram",
        "timestamp": "2024-01-15T10:30:00.000Z",
        "isVideo": false,
        "isCarousel": true
      }
    ]
  },
  "options": {
    "maxFollowers": 50,
    "maxFollowing": 50,
    "maxPosts": 12,
    "includeFollowers": true,
    "includeFollowing": true,
    "includePosts": true,
    "includeStories": true
  },
  "timestamp": "2025-11-18T22:00:00.000Z"
}
Response 401
{
  "success": false,
  "error": "Unauthorized - API key required"
}
Response 500
{
  "success": false,
  "error": "Error message",
  "timestamp": "2025-11-18T22:00:00.000Z"
}
Status Codes
200 OK - Başarılı istek
401 Unauthorized - Geçersiz veya eksik API key
500 Internal Server Error - Sunucu hatası