# Need Rest API for finding last 5 jobs run on particular Agent

**URL:** https://community.jenkins.io/t/need-rest-api-for-finding-last-5-jobs-run-on-particular-agent/21625
**Category:** Ask a question
**Created:** [October 9, 2024, 6:49am UTC](https://community.jenkins.io/t/need-rest-api-for-finding-last-5-jobs-run-on-particular-agent/21625 "2024-10-09T06:49:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pradip10](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@pradip10](https://community.jenkins.io/u/pradip10)
#### Post date: [October 9, 2024, 6:49am UTC](https://community.jenkins.io/t/need-rest-api-for-finding-last-5-jobs-run-on-particular-agent/21625/1 "2024-10-09T06:49:15Z")

</div>

We have multiple Jenkins Agents and I’m trying to find last 5 jobs run on each Agents so that we can keep the track of agent activity.

So do we have any rest api to achieve above requirement ? i’m aware of [http://jenkins-url/computer/agent/builds](http://jenkins-url/computer/agent/builds) to fetch build history but it’s not working in curl.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)
#### Post date: [October 9, 2024, 10:44am UTC](https://community.jenkins.io/t/need-rest-api-for-finding-last-5-jobs-run-on-particular-agent/21625/2 "2024-10-09T10:44:28Z")

</div>

This can’t work with curl as this endpoint is not a rest api. It uses javascript to dynamically fetch the builds on that agent.  
Afaik there is no rest api for this. I would also not recommend as finding the builds that ran on an agent is an expensive operation.
