Job Results
Use the Job API to retrieve results for a specific job.
Job Results Object{
"rowCount": 11,
"schema": [
{
"name": "pickup_datetime",
"type": {
"name": "TIMESTAMP"
}
},
{
"name": "passenger_count",
"type": {
"name": "BIGINT"
}
},
{
"name": "trip_distance_mi",
"type": {
"name": "DOUBLE"
}
},
{
"name": "fare_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "tip_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "total_amount",
"type": {
"name": "DOUBLE"
}
}
],
"rows": [
{
"pickup_datetime": "2013-02-10 20:00:00.000",
"passenger_count": 9,
"trip_distance_mi": 3,
"fare_amount": 10,
"tip_amount": 3,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:15:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.26,
"fare_amount": 7.5,
"tip_amount": 0,
"total_amount": 8
},
{
"pickup_datetime": "2013-05-31 16:40:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.73,
"fare_amount": 5,
"tip_amount": 1.2,
"total_amount": 7.7
},
{
"pickup_datetime": "2013-05-27 19:03:00.000",
"passenger_count": 2,
"trip_distance_mi": 9.23,
"fare_amount": 27.5,
"tip_amount": 5,
"total_amount": 38.33
},
{
"pickup_datetime": "2013-05-31 16:24:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.27,
"fare_amount": 12,
"tip_amount": 0,
"total_amount": 13.5
},
{
"pickup_datetime": "2013-05-27 19:17:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.71,
"fare_amount": 5,
"tip_amount": 0,
"total_amount": 5.5
},
{
"pickup_datetime": "2013-05-27 19:11:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.52,
"fare_amount": 10.5,
"tip_amount": 3.15,
"total_amount": 14.15
},
{
"pickup_datetime": "2013-05-31 16:41:00.000",
"passenger_count": 5,
"trip_distance_mi": 1.01,
"fare_amount": 6,
"tip_amount": 1.1,
"total_amount": 8.6
},
{
"pickup_datetime": "2013-05-31 16:37:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.25,
"fare_amount": 8.5,
"tip_amount": 0,
"total_amount": 10
},
{
"pickup_datetime": "2013-05-31 16:39:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.04,
"fare_amount": 10,
"tip_amount": 1.5,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:02:00.000",
"passenger_count": 1,
"trip_distance_mi": 11.73,
"fare_amount": 32.5,
"tip_amount": 8.12,
"total_amount": 41.12
}
]
}
Job Results Attributes
rowCount Integer
Number of rows the job returned.
Example: 11
schema Array of Object
Array of schema definitions for the data the job returned.
rows Array of Object
Array of the data the job returned for each row of results.
Retrieving Job Results
Method and URLGET /api/v3/job/{id}/results
Parameters
id Path String (UUID)
Unique identifier of the job to retrieve. Get the job ID from responses to SQL API requests.
Example: 6j6c34cf-9drf-b07a-5ab7-abea69a66d00
limit Query Integer Optional
Number of rows to retrieve. Maximum valid value is 500
. Default is 100
. Use with the offset
query parameter to paginate and retrieve more than the first 500 results. Read Limit and Offset Query Parameters for usage examples.
offset Query Integer Optional
Number of rows to skip for pagination. Default is 0
. Read Limit and Offset Query Parameters for usage examples.
Example Request
curl -X GET 'https://{hostname}/api/v3/job/6j6c34cf-9drf-b07a-5ab7-abea69a66d00/results' \
--header 'Authorization: Bearer <PersonalAccessToken>' \
--header 'Content-Type: application/json'
{
"rowCount": 11,
"schema": [
{
"name": "pickup_datetime",
"type": {
"name": "TIMESTAMP"
}
},
{
"name": "passenger_count",
"type": {
"name": "BIGINT"
}
},
{
"name": "trip_distance_mi",
"type": {
"name": "DOUBLE"
}
},
{
"name": "fare_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "tip_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "total_amount",
"type": {
"name": "DOUBLE"
}
}
],
"rows": [
{
"pickup_datetime": "2013-02-10 20:00:00.000",
"passenger_count": 9,
"trip_distance_mi": 3,
"fare_amount": 10,
"tip_amount": 3,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:15:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.26,
"fare_amount": 7.5,
"tip_amount": 0,
"total_amount": 8
},
{
"pickup_datetime": "2013-05-31 16:40:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.73,
"fare_amount": 5,
"tip_amount": 1.2,
"total_amount": 7.7
},
{
"pickup_datetime": "2013-05-27 19:03:00.000",
"passenger_count": 2,
"trip_distance_mi": 9.23,
"fare_amount": 27.5,
"tip_amount": 5,
"total_amount": 38.33
},
{
"pickup_datetime": "2013-05-31 16:24:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.27,
"fare_amount": 12,
"tip_amount": 0,
"total_amount": 13.5
},
{
"pickup_datetime": "2013-05-27 19:17:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.71,
"fare_amount": 5,
"tip_amount": 0,
"total_amount": 5.5
},
{
"pickup_datetime": "2013-05-27 19:11:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.52,
"fare_amount": 10.5,
"tip_amount": 3.15,
"total_amount": 14.15
},
{
"pickup_datetime": "2013-05-31 16:41:00.000",
"passenger_count": 5,
"trip_distance_mi": 1.01,
"fare_amount": 6,
"tip_amount": 1.1,
"total_amount": 8.6
},
{
"pickup_datetime": "2013-05-31 16:37:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.25,
"fare_amount": 8.5,
"tip_amount": 0,
"total_amount": 10
},
{
"pickup_datetime": "2013-05-31 16:39:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.04,
"fare_amount": 10,
"tip_amount": 1.5,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:02:00.000",
"passenger_count": 1,
"trip_distance_mi": 11.73,
"fare_amount": 32.5,
"tip_amount": 8.12,
"total_amount": 41.12
}
]
}
For jobs with a jobState value other than COMPLETED
, the response includes an error message instead of the job results object. The job's status is listed inside brackets in the error message (CANCELED
, FAILED
, or RUNNING
):
{
"errorMessage": "Can not fetch details for a job that is in [FAILED] state.",
"moreInfo": ""
}
Response Status Codes
200 OK
400 Bad Request
403 Forbidden
404 Not Found