# Get User Experience Statistics GET /api/v1/experiences/statistics/ Get statistics about experiences created by a user. Returns counts for each experience type (Quests, AI Experts, AI Notes, AI Studios) and total count. If no username is provided in the path, returns statistics for the authenticated user. If a username is provided, returns statistics for that specific user. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/experiences/user-experiences-statistics-retrieve ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/experiences/statistics/: get: operationId: user-experiences-statistics-retrieve summary: Get User Experience Statistics description: >- Get statistics about experiences created by a user. Returns counts for each experience type (Quests, AI Experts, AI Notes, AI Studios) and total count. If no username is provided in the path, returns statistics for the authenticated user. If a username is provided, returns statistics for that specific user. tags: - subpackage_experiences parameters: - name: username in: path description: >- Username to get statistics for. If not provided, returns stats for the authenticated user. required: true schema: type: string responses: '200': description: User experience statistics retrieved successfully content: application/json: schema: $ref: '#/components/schemas/UserStatistics' '401': description: Unauthorized content: application/json: schema: description: Any type '404': description: User not found content: application/json: schema: description: Any type components: schemas: UserStatistics: type: object properties: username: type: string description: Username of the user quests_created: type: integer description: Number of Quest experiences created ai_experts_created: type: integer description: Number of AI Expert experiences created ai_notes_created: type: integer description: Number of AI Note experiences created podcasts_created: type: integer description: Number of Podcast experiences created ai_videos_created: type: integer description: Number of AI Video experiences created ai_studios_created: type: integer description: Number of AI Studio experiences created total_experiences: type: integer description: Total number of experiences created required: - username - quests_created - ai_experts_created - ai_notes_created - podcasts_created - ai_videos_created - ai_studios_created - total_experiences description: Serializer for user experience statistics. title: UserStatistics ``` ## SDK Code Examples ```python Example statistics for authenticated user import requests url = "https://api.example.com/api/v1/experiences/statistics/" response = requests.get(url) print(response.json()) ``` ```javascript Example statistics for authenticated user const url = 'https://api.example.com/api/v1/experiences/statistics/'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example statistics for authenticated user package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/experiences/statistics/" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Example statistics for authenticated user require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/experiences/statistics/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java Example statistics for authenticated user import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.example.com/api/v1/experiences/statistics/") .asString(); ``` ```php Example statistics for authenticated user request('GET', 'https://api.example.com/api/v1/experiences/statistics/'); echo $response->getBody(); ``` ```csharp Example statistics for authenticated user using RestSharp; var client = new RestClient("https://api.example.com/api/v1/experiences/statistics/"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift Example statistics for authenticated user import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/experiences/statistics/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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 Example statistics for a specific user import requests url = "https://api.example.com/api/v1/experiences/statistics/" response = requests.get(url) print(response.json()) ``` ```javascript Example statistics for a specific user const url = 'https://api.example.com/api/v1/experiences/statistics/'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example statistics for a specific user package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/experiences/statistics/" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Example statistics for a specific user require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/experiences/statistics/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java Example statistics for a specific user import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.example.com/api/v1/experiences/statistics/") .asString(); ``` ```php Example statistics for a specific user request('GET', 'https://api.example.com/api/v1/experiences/statistics/'); echo $response->getBody(); ``` ```csharp Example statistics for a specific user using RestSharp; var client = new RestClient("https://api.example.com/api/v1/experiences/statistics/"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift Example statistics for a specific user import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/experiences/statistics/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```