Sujan Reddy, A.Rudra, B.2026-02-042022International Journal of Electronic Security and Digital Forensics, 2022, 14, 6, pp. 638-6581751911Xhttps://doi.org/10.1504/ijesdf.2022.126451https://idr.nitk.ac.in/handle/123456789/22741Application programming interfaces (APIs) are playing a vital role in every online business. The objective of this study is to analyse the incoming requests to a target API and flag any malicious activity. This paper proposes a solution based on sequence models and transformers for the identification of whether an API request has SQL injections, code injections, XSS attacks, operating system (OS) command injections, and other types of malicious injections or not. In this paper, we observe that transformers outperform B-RNNs in detecting malicious activity which is present in API requests. We also propose a novel heuristic procedure that minimises the number of false positives. We observe that the RoBERTa transformer outperforms and gives an accuracy of 100% on our dataset. We observe that the heuristic procedure works well in reducing the number of false positives when a large number of false positives exist in the predictions of the models. © © 2022 Inderscience Enterprises Ltd.Application programming interfaces (API)Heuristic methodsQuery languagesApplications programming interfacesBERTBidirectional recurrent neural networksGated recurrent unitGRURNNSecuritySQLStructured Query LanguageVanillum recurrent neural networkRecurrent neural networksDetection of injections in API requests using recurrent neural networks and transformers