# Show Study predicted recruitment time GET https://api.prolific.com/api/v1/studies/{study_id}/predicted-recruitment-time/ Returns the predicted recruitment time for the study if it was published right now, based on a machine learning model. The recruitment time is the time from publish to the time when the final participant starts their submission. It does not account for the time to complete the submission. Reference: https://beta-docs.prolific.com/api-reference/studies/get-study-predicted-recruitment-time ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Show Study predicted recruitment time version: endpoint_studies.GetStudyPredictedRecruitmentTime paths: /api/v1/studies/{study_id}/predicted-recruitment-time/: get: operationId: get-study-predicted-recruitment-time summary: Show Study predicted recruitment time description: >- Returns the predicted recruitment time for the study if it was published right now, based on a machine learning model. The recruitment time is the time from publish to the time when the final participant starts their submission. It does not account for the time to complete the submission. tags: - - subpackage_studies parameters: - name: study_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: Return the predicted recruitment time for the study content: application/json: schema: $ref: '#/components/schemas/StudyPredictedRecruitmentTimeResponse' '400': description: Error content: {} components: schemas: StudyPredictedRecruitmentTimeResponse: type: object properties: precise_recruitment_time_hours: type: number format: double description: The predicted recruitment time in hours lower_bound_hours: type: number format: double description: The lower bound of the predicted recruitment time in hours upper_bound_hours: type: number format: double description: The upper bound of the predicted recruitment time in hours display_string: type: string description: A human-readable string representing the predicted recruitment time limit_at: type: number format: double description: >- The limit at which the accuracy of the prediction becomes unstable. This should be used when rendering the recruitment times in a GUI. For example if the limit_at is 10, and the predicted recruitment time is 12 hours, the display string should be "10 hours+". This has been done for you in the display_string field. ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/studies/study_id/predicted-recruitment-time/" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/studies/study_id/predicted-recruitment-time/'; 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/study_id/predicted-recruitment-time/" 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/study_id/predicted-recruitment-time/") 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/study_id/predicted-recruitment-time/") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/studies/study_id/predicted-recruitment-time/', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/studies/study_id/predicted-recruitment-time/"); 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/study_id/predicted-recruitment-time/")! 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() ```