LLM-Based RESTful Web API Service Discovery
摘要
The rapid advancement of service computing has led to an explosion in the number of RESTful Web APIs available online. Although this abundance offers developers greater flexibility, it also poses significant challenges in accurately discovering the required Web APIs that meet specific user queries. Existing Web API discovery methods mainly rely on keyword matching or semantic analysis of API description documents and interfaces. However, these methods often fail to effectively align user queries with the semantic content of Web API descriptions, leading to suboptimal results. To address this issue, we propose an LLM-based Web API discovery framework tailored for the RapidAPI platform. Specifically, we design a three-level prompt strategy, category level, API level, and endpoint level, that progressively narrows the search space to accurately identify relevant APIs and the corresponding endpoints. Additionally, we incorporate a self-checking mechanism to improve the accuracy and reliability of the discovery process. Extensive experiments across diverse development scenarios demonstrate that the proposed method outperforms baseline methods on multiple LLMs. Case studies further validate the effectiveness of the proposed method, highlighting the potential of large language models in advancing Web API service discovery.