# Get demographic export history GET https://api.prolific.com/api/v1/studies/{id}/demographic-export-history/ Retrieve the latest demographic export request history for a study. This endpoint returns information about your most recent export request, including the filters used and the total number of export combinations made. **Usage**: Use this endpoint to check your current export usage and see what filters were used in your latest request. This helps you understand your remaining export quota and track your export history. **Export Limits**: You are limited to 2 different filter combinations per study. This endpoint helps you track your usage against this limit. Learn more on [Exporting Prolific demographic data](https://researcher-help.prolific.com/en/article/b2943f). Reference: https://beta-docs.prolific.com/api-reference/studies/get-demographic-export-history ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get demographic export history version: endpoint_studies.GetDemographicExportHistory paths: /api/v1/studies/{id}/demographic-export-history/: get: operationId: get-demographic-export-history summary: Get demographic export history description: >- Retrieve the latest demographic export request history for a study. This endpoint returns information about your most recent export request, including the filters used and the total number of export combinations made. **Usage**: Use this endpoint to check your current export usage and see what filters were used in your latest request. This helps you understand your remaining export quota and track your export history. **Export Limits**: You are limited to 2 different filter combinations per study. This endpoint helps you track your usage against this limit. Learn more on [Exporting Prolific demographic data](https://researcher-help.prolific.com/en/article/b2943f). tags: - - subpackage_studies parameters: - name: id in: path description: Study ID required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: Export history retrieved successfully content: application/json: schema: $ref: '#/components/schemas/DemographicExportHistoryResponse' '400': description: Error content: {} components: schemas: SelectFilter: type: object properties: filter_id: type: string description: ID of the "select" type filter. selected_values: type: array items: type: string description: >- This schema applies for filters of the `select` type, as defined in the [filter list response](\#tag/Filters/paths/~1api~1v1~1filters~1/get). Array of IDs matching the response IDs, from the `select` filter's `choices` (see response linked above). String format should match the `data_type` of the `select` filter's `choices` (see response linked above). weightings: type: object additionalProperties: type: number format: double description: >- Ratios to control the distribution of participants across the selected values. Integer percentages, floats, and exact quantities are valid inputs. required: - filter_id - selected_values RangeFilterSelectedRangeLower: oneOf: - type: integer - type: string - type: number format: double RangeFilterSelectedRangeUpper: oneOf: - type: integer - type: string - type: number format: double RangeFilterSelectedRange: type: object properties: lower: $ref: '#/components/schemas/RangeFilterSelectedRangeLower' description: Your selected lower bound for the range. upper: $ref: '#/components/schemas/RangeFilterSelectedRangeUpper' description: Your selected upper bound for the range. RangeFilterWeightingsSelectedRangeLower: oneOf: - type: integer - type: string - type: number format: double RangeFilterWeightingsSelectedRangeUpper: oneOf: - type: integer - type: string - type: number format: double RangeFilterWeightingsSelectedRange: type: object properties: lower: $ref: '#/components/schemas/RangeFilterWeightingsSelectedRangeLower' upper: $ref: '#/components/schemas/RangeFilterWeightingsSelectedRangeUpper' RangeFilterWeightings: type: object properties: selected_range: $ref: '#/components/schemas/RangeFilterWeightingsSelectedRange' weighting: type: number format: double required: - selected_range - weighting RangeFilter: type: object properties: filter_id: type: string description: ID of the "range" type filter. selected_range: $ref: '#/components/schemas/RangeFilterSelectedRange' description: >- This schema applies for filters of the `range` type, as defined in the [filter list response](\#tag/Filters/paths/~1api~1v1~1filters~1/get). A dictionary with two possible objects, 'lower' and 'upper'. At least one must be present and a non-null value. The expected data type for these values is defined by the `range` filter's `data_type` (see response linked above). If the data_type is a date, string format should be a parseable ISO8601 date string. Date values should be provided as a string in ISO 8601 format. Leaving a value as null will result in that bound being set to the lowest or highest possible value, depending on whether it is the upper or lower bound. weightings: $ref: '#/components/schemas/RangeFilterWeightings' description: >- Ratios to control the distribution of participants across the selected values. Integers and exact quantities are valid inputs. required: - filter_id - selected_range DemographicExportHistoryResponseFiltersItems: oneOf: - $ref: '#/components/schemas/SelectFilter' - $ref: '#/components/schemas/RangeFilter' DemographicExportHistoryResponse: type: object properties: count: type: integer description: >- Total number of different filter combinations that have been requested for demographic export filters: type: array items: $ref: '#/components/schemas/DemographicExportHistoryResponseFiltersItems' description: >- The filters used in the most recent export request. Returns an empty array if no exports have been requested yet. This shows you exactly what filter combination was used in your latest request, helping you track your export usage. required: - count - filters ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/studies/id/demographic-export-history/" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/studies/id/demographic-export-history/'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/studies/id/demographic-export-history/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/studies/id/demographic-export-history/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.prolific.com/api/v1/studies/id/demographic-export-history/") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/studies/id/demographic-export-history/', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/studies/id/demographic-export-history/"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/demographic-export-history/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```