The invention relates to the technical field of internet development, in particular to a method and
system for obtaining a website API interface through one key, and the method comprises the steps that S1, original
HTML content of a webpage is obtained through a
web crawler by entering a URL of a target website; s2, analyzing website contents, and
processing HTML (
Hypertext Markup Language) data,
JavaScript data and CSS (Cascading
Style Sheet) data S3, through a predefined API
feature matching rule, scanning and matching each type of data after analysis, and identifying API interface information exposed in the webpage; s4, a browser
automation tool is used for simulating user interaction and dynamic content loading,
JavaScript codes are executed in a matched mode to conduct dynamic code analysis, and API calling information hidden in the
JavaScript codes is recognized; s5, extracting the identified API interface
information data; and S6, carrying out structured
processing on the extracted and identified API interface information, and generating an API interface
directory to be displayed to a user. According to the method, the target website content can be automatically captured, the API interface in the target website content can be identified, and the structured API interface catalog is provided, so that a user can quickly search and integrate the required API interface.