So I am trying to automate the API testing through Azure pipelines and I have to install "newman" every time which takes a lot of time. So is there any way that I do not have to install newman while running the pipeline? Or any other approach that can be used?
You could install "newman" on your Self-hosted agent and specify Self-hosted agent to run the "newman" job.
"newman" is not an included software for Microsoft-hosted agents. Check this link: [Microsoft-hosted agents for Azure Pipelines - Azure Pipelines | Microsoft Docs
Also, you could raise a feedback ticket to install "newman" as default software for Microsoft-hosted agents: [Suggest a feature - Visual Studio (Windows) | Microsoft Docs