GA Lite

ডেভেলপার

API ডকুমেন্টেশন

GA Lite API দিয়ে scripts, apps বা AI clients থেকে Google Analytics 4 (GA4), Google Search Console (GSC) এবং Bing Webmaster Tools ডেটা পড়ুন।

দ্রুত শুরু

Account settings থেকে API Key তৈরি করুন, তারপর Bearer token হিসেবে পাঠান। সব API routes read-only এবং JSON রিটার্ন করে।

  • REST-style reads-এর জন্য /api/v1 ব্যবহার করুন।
  • Claude, Cursor বা অন্য MCP-aware client সংযোগের সময় /api/mcp ব্যবহার করুন।
  • period today, yesterday, 7days, 28days, 90days, 180days, 365days এবং custom_START_END সাপোর্ট করে।

Base URL

https://galite.io/api/v1

Header

Authorization: Bearer sk_live_xxxxxxxxxxxxx

প্রমাণীকরণ

API Keys GA Lite-এর ভেতরে তৈরি হয়। এগুলো server-side রাখুন এবং expose হলে rotate করুন।

Header

curl https://galite.io/api/v1/projects/list \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxx"

Projects

Project endpoints আপনি যেসব site access করতে পারেন এবং প্রতিটি project-এর connected data sources রিটার্ন করে।

Projects list

GET https://galite.io/api/v1/projects/list
GET https://galite.io/api/v1/projects/{projectKey}

Site metrics

Metrics endpoints একটি project-এর GA4 data পড়ে। force=1 শুধু manual refresh flows-এ ব্যবহার করুন।

Summary

GET https://galite.io/api/v1/metrics/{projectKey}/summary?period=28days
GET https://galite.io/api/v1/metrics/{projectKey}/timeseries?period=28days&metric=screenPageViews
GET https://galite.io/api/v1/metrics/{projectKey}/dimension?dimension=country&period=28days
GET https://galite.io/api/v1/metrics/{projectKey}/realtime

Search data

Search endpoints Google Search Console ও Bing Webmaster data combine করে। sp parameter all, gsc বা bing নির্বাচন করে।

Search summary

GET https://galite.io/api/v1/metrics/{projectKey}/search/summary?period=28days&sp=all
GET https://galite.io/api/v1/metrics/{projectKey}/search/timeseries?period=28days&sp=gsc
GET https://galite.io/api/v1/metrics/{projectKey}/search/dimension?dimension=query&period=28days&sp=bing

Funnels

Public API-তে funnels read-only। Funnel definitions dashboard-এ create ও edit করুন।

Funnels list

GET https://galite.io/api/v1/projects/{projectKey}/funnels/list
GET https://galite.io/api/v1/funnels/{funnelKey}/results?period=28days

Raw provider proxy

Raw proxy endpoints native GA4, GSC বা Bing request shapes-এর compatibility-এর জন্য। Provider-native response দরকার না হলে curated endpoints ব্যবহার করুন।

Raw GA4 report

POST https://galite.io/api/v1/raw/ga4/proxy

{
  "project_key": "PROJECT_KEY",
  "path": "properties/PROPERTY_ID:runReport",
  "body": {
    "dateRanges": [{ "startDate": "28daysAgo", "endDate": "today" }],
    "metrics": [{ "name": "screenPageViews" }]
  }
}

MCP endpoint

MCP clients defaultভাবে browser OAuth ব্যবহার করে। API Keys scripts ও custom clients-এর fallback হিসেবে থাকে।

MCP endpoint

POST https://galite.io/api/mcp