<@U04S8PLJWMT> how to get the job stats using the ...
# ask-ai
a
@kapa.ai how to get the job stats using the airbyte api
k
To get job statistics using the Airbyte API, you can use the
/jobs
endpoint to list jobs and retrieve details such as status, duration, bytes synced, and rows synced. Here’s how you can do it: ### 1. List Jobs You can list jobs (optionally filtered by connectionId, jobType, status, etc.) using the following endpoint:
Copy code
GET https://api.airbyte.com/v1/jobs?connectionId=<YOUR_CONNECTION_ID>
This will return a list of jobs with details like jobId, status, jobType, startTime, duration, bytesSynced, and rowsSynced. You can further filter or paginate the results using query parameters such as
limit
,
offset
,
jobType
, and `status`[Airbyte Public API - Jobs](https://reference.airbyte.com/reference/start). ### 2. Get Job Details To get detailed statistics for a specific job, use:
Copy code
GET https://api.airbyte.com/v1/jobs/{jobId}
This will return details for the job, including: -
status
(e.g., running, succeeded, failed) -
duration
-
bytesSynced
-
rowsSynced
-
startTime
-
lastUpdatedAt
[Airbyte Public API - Jobs](https://reference.airbyte.com/reference/start). ### Example (C#) Here’s a code snippet that triggers a sync and then polls for job status and statistics:
Copy code
csharp // Trigger a job var client = new RestClient("https://api.airbyte.com/v1/jobs"); var request = new RestRequest(); request.AddHeader("accept", "application/json"); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Bearer {YourApiKey}"); request.AddParameter("application/json", "{\"connectionId\":\"YourConnectionID\",\"jobType\":\"sync\"}", ParameterType.RequestBody); dynamic response = client.ExecutePost(request);  // Get jobId from response var apiResponse = JsonConvert.DeserializeObject(response.Content); string jobId = apiResponse.jobId;  // Poll for job status and stats while(jobStatus == "running")   {       client = new RestClient("https://api.airbyte.com/v1/jobs/" + jobId);     request = new RestRequest();     request.AddHeader("accept", "application/json");     request.AddHeader("Authorization", "Bearer {YourApiKey}");     dynamic statusResponse = client.ExecuteGet(request);     apiResponse = JsonConvert.DeserializeObject(statusResponse.Content);     jobStatus = apiResponse.status;     // Access stats: apiResponse.rowsSynced, apiResponse.bytesSynced, etc.     Thread.Sleep(10000); }
[Create and Monitor a Data Pipeline Using the Airbyte API](https://airbyte.com/tutorials/create-and-monitor-a-data-pipeline-using-the-airbyte-api) --- Summary: - Use
GET /jobs
to list jobs and see their stats. - Use
GET /jobs/{jobId}
to get detailed stats for a specific job. - Stats available include status, duration, bytes synced, and rows synced.
a
@kapa.ai any endpoint that returns attempts, rowsEmitted
k
A message from kapa.ai
Based on the provided knowledge sources, the Airbyte public API documentation describes the
/jobs
endpoint, which returns job-level statistics such as status, duration, bytesSynced, and rowsSynced. However, there is no mention of an endpoint that directly returns detailed attempt-level information or the specific metric rowsEmitted. The API response for listing jobs includes fields like
jobId
,
status
,
jobType
,
startTime
,
duration
,
bytesSynced
, and
rowsSynced
, but does not include per-attempt details or a
rowsEmitted
field. There is also no documented endpoint for retrieving attempts for a job or their granular stats in the referenced API documentation or forum discussions [Airbyte Public API - Jobs](https://reference.airbyte.com/reference/start) [Forum Post: Is it possible to fetch the sync history through Airbyte API?](https://discuss.airbyte.io/t/2235). Summary: - There is no documented Airbyte API endpoint that returns attempt-level details or the
rowsEmitted
metric. - The available endpoints provide job-level stats only. If you need attempt-level data, you may need to access the Airbyte internal database directly (see the
attempts
table in the data catalog), but this is not exposed via the public API [Airbyte Databases Data Catalog](https://docs.airbyte.com/platform/next/understanding-airbyte/database-data-catalog#jobs-database).
a
@kapa.ai can internal api communication be used with airbyte 2.0.8
k
A message from kapa.ai
I'm sorry, but the knowledge sources do not contain information about using internal API communication with Airbyte version 2.0.8. The available documentation only references the public API and notes that the internal Configuration API is deprecated and not supported for managing your Airbyte workspace. It is described as an internal API for communication between Airbyte components and is used at your own risk, with the possibility of changes by the Airbyte Engineering team at any time. There is no explicit mention of its availability or support in Airbyte 2.0.8 or later versions [API documentation](https://docs.airbyte.com/platform/next/api-documentation). If you require internal API access for a specific use case, it is recommended to use the public API or consult the official Airbyte documentation for your version.