# AI Studios - Public Impact Metrics POST /api/v1/aistudios/public-impact/ Content-Type: application/json **PUBLIC ACCESS:** 30-day impact metrics for any authenticated user. Provides public engagement analytics including: - Total plays (Quest plays + Podcast listens) - Likes count in 30-day period - Quest completion rate (completions / plays) - Active users count - Saves/bookmarks count - Influence score (scaled 1-100 based on weighted engagement metrics) **Access Control:** Authenticated users only. **Caching:** Response cached for 24 hours. **Time Period:** Fixed 30-day window for all metrics. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/ai-studios-public-metrics/aistudios-public-impact-create ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/aistudios/public-impact/: post: operationId: aistudios-public-impact-create summary: AI Studios - Public Impact Metrics description: >- **PUBLIC ACCESS:** 30-day impact metrics for any authenticated user. Provides public engagement analytics including: - Total plays (Quest plays + Podcast listens) - Likes count in 30-day period - Quest completion rate (completions / plays) - Active users count - Saves/bookmarks count - Influence score (scaled 1-100 based on weighted engagement metrics) **Access Control:** Authenticated users only. **Caching:** Response cached for 24 hours. **Time Period:** Fixed 30-day window for all metrics. tags: - subpackage_aiStudiosPublicMetrics responses: '200': description: Public impact metrics retrieved successfully content: application/json: schema: $ref: '#/components/schemas/AIStudiosPublicImpact' '403': description: Forbidden - Authentication required content: application/json: schema: description: Any type '404': description: Publication not found content: application/json: schema: description: Any type requestBody: content: application/json: schema: type: object properties: url: type: string description: Publication custom URL required: - url components: schemas: PublicationBasicInfo: type: object properties: id: type: integer name: type: string custom_url: type: string required: - id - name - custom_url description: Basic publication info for public metrics. title: PublicationBasicInfo PublicImpactMetrics: type: object properties: total_plays: type: integer likes_count: type: integer completion_rate: type: number format: double active_users: type: integer saves_count: type: integer influence_score: type: number format: double description: Scaled between 1-100 based on engagement metrics required: - total_plays - likes_count - completion_rate - active_users - saves_count - influence_score description: Public impact metrics for 30-day period. title: PublicImpactMetrics AIStudiosPublicImpact: type: object properties: publication_info: $ref: '#/components/schemas/PublicationBasicInfo' metrics: $ref: '#/components/schemas/PublicImpactMetrics' time_period_days: type: integer generated_at: type: string format: date-time required: - publication_info - metrics - time_period_days - generated_at description: |- Serializer for AI Studio public impact metrics. Returns 30-day public engagement metrics for any authenticated user. title: AIStudiosPublicImpact ``` ## SDK Code Examples ```python Example public impact metrics response import requests url = "https://api.example.com/api/v1/aistudios/public-impact/" headers = {"Content-Type": "application/json"} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Example public impact metrics response const url = 'https://api.example.com/api/v1/aistudios/public-impact/'; const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: undefined}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example public impact metrics response package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/aistudios/public-impact/" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Example public impact metrics response require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/aistudios/public-impact/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' response = http.request(request) puts response.read_body ``` ```java Example public impact metrics response import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/aistudios/public-impact/") .header("Content-Type", "application/json") .asString(); ``` ```php Example public impact metrics response request('POST', 'https://api.example.com/api/v1/aistudios/public-impact/', [ 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Example public impact metrics response using RestSharp; var client = new RestClient("https://api.example.com/api/v1/aistudios/public-impact/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request); ``` ```swift Example public impact metrics response import Foundation let headers = ["Content-Type": "application/json"] let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/aistudios/public-impact/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```python Request public impact metrics import requests url = "https://api.example.com/api/v1/aistudios/public-impact/" payload = { "url": "ai-research-studio" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Request public impact metrics const url = 'https://api.example.com/api/v1/aistudios/public-impact/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"ai-research-studio"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Request public impact metrics package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/aistudios/public-impact/" payload := strings.NewReader("{\n \"url\": \"ai-research-studio\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Request public impact metrics require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/aistudios/public-impact/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"url\": \"ai-research-studio\"\n}" response = http.request(request) puts response.read_body ``` ```java Request public impact metrics import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/aistudios/public-impact/") .header("Content-Type", "application/json") .body("{\n \"url\": \"ai-research-studio\"\n}") .asString(); ``` ```php Request public impact metrics request('POST', 'https://api.example.com/api/v1/aistudios/public-impact/', [ 'body' => '{ "url": "ai-research-studio" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Request public impact metrics using RestSharp; var client = new RestClient("https://api.example.com/api/v1/aistudios/public-impact/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"url\": \"ai-research-studio\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Request public impact metrics import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["url": "ai-research-studio"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/aistudios/public-impact/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```