# API-Spector: an API-to-API Specification Recommendation Engine

**Authors:** Sae Young Moon, Fran Silavong, Sean Moran  
**arXiv:** [2212.07253](https://arxiv.org/abs/2212.07253)  
**Date:** 2022-12-14  
**Summary page:** https://www.summarizepaper.com/en/paper/2212.07253v1/

## Key points

- API-Spector is a recommendation engine that helps developers design sustainable APIs
- It retrieves relevant OpenAPI specification components from public or internal databases
- It addresses the lack of standardized methods for comparing API designs
- Innovative feature extraction techniques are used, optimized for the highly technical API specification domain
- Novel methods of processing and extracting key information from OpenAPI specifications are used
- Natural language text similarity is used to characterize endpoints based on descriptions and summaries found in the operations section
- Pre-trained language models such as BERT and SENT-BERT are used to obtain contextual representations of the text
- Keyword tokens are obtained through pre-processing the entire text which generates TF-IDF and PPMI scores for these keywords allowing representation of domain-specific terms not well represented in pre-trained language models.
- The enriched text features obtained by combining both approaches consistently outperform other text features across all evaluation tasks.
- User studies evaluating API-Spector's usefulness achieved best performance with 0.690 recall, 0.475 precision, and 0.562 F1 scores compared to baseline models.
- Overall, API-Spector provides guidance to accelerate development processes thoughtfully designed APIs that promote code maintainability and quality while allowing developers to learn from existing established examples and potentially identify redundancies in their work.

## Summary

API-Spector is a recommendation engine that assists developers in designing sustainable APIs by retrieving relevant OpenAPI specification components from a public or internal database. It addresses the lack of standardized methods for comparing API designs by using innovative feature extraction techniques optimized for the highly technical API specification domain. These include novel methods of processing and extracting key information from OpenAPI specifications as well as natural language text similarity to characterize endpoints based on descriptions and summaries found in the operations section. To obtain contextual representations of the text, pre-trained language models such as BERT and SENT-BERT are used. Additionally, keyword tokens are obtained through pre-processing the entire text which generates TF-IDF and PPMI scores for these keywords allowing representation of domain-specific terms not well represented in pre-trained language models. The enriched text features obtained by combining both approaches consistently outperform other text features across all evaluation tasks. User studies evaluating API-Spector's usefulness in a realistic scenario achieved best performance with 0.690 recall, 0.475 precision, and 0.562 F1 scores compared to baseline models. Overall, API-Spector provides guidance to accelerate development processes thoughtfully designed APIs that promote code maintainability and quality while allowing developers to learn from existing established examples and potentially identify redundancies in their work.
