# US 12,112,144 B2 · API specification generation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,112,144 B2
- Document ID: US12112144B2
- Status: Granted
- Kind: B2
- Application number: 17/502,297
- Filed: 2021-10-15
- Published: 2022-02-03
- Granted: 2024-10-08
- Earliest claimed: 2019-05-17
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Alex David Lester; Sibo Liu; Che Liu; Jared Scott Borner; Andrew Marsh Gardiner; Matthew Symonds; Kenneth Chan; Michael Christopher Yara; Terrence Li; Joy Aloysius Thomas; Sri Harsha Vardhan Reddy Chevuru; Tsenguun Tsogbadrakh
- Web page: https://patentgrep.com/patent/US12112144B2

## CPC

- G06F 8/10: Requirements analysis; Specification techniques
- G06F 8/74: Reverse engineering; Extracting design information from source code
- G06F 9/54: Interprogram communication
- G06F 16/9027: {Trees}
- G06F 16/903: Querying (for retrieval from the web G06F16/953)
- G06F 2209/541: Client-server
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems that facilitate automatic generation of Application Programming Interface (API) specification from web traffic. Methods include obtaining a plurality of API requests and responses to the plurality of API requests. Methods include processing these API requests and responses to API requests to identify one or more attributes, such as, for example, variables, query parameters, response status codes, and response schemas. Methods include identifying variables using a tree data structure to represent resource paths. Methods include identifying query parameters based on resource items in resource paths. Methods include determining that the API call does not conform to the API specification by comparing one or more attributes of the API call with the attributes of the API specification.

## Claims

### Claim 1

A method for generation of an application program interface (API) specification, comprising:
receiving API traffic communicated between one or more client devices and at least one backend system;
analyzing the API traffic to identify one or more attributes associated with the API traffic, the one or more attributes comprising attributes associated with API requests and API responses corresponding to the API traffic that are determined to be valid; and
generating the API specification based on the one or more attributes identified as associated with one or more valid API requests.

### Claim 2 (depends on 1)

The method of claim 1, comprising updating the API specification based on a change associated with the API traffic.

### Claim 3 (depends on 1)

The method of claim 1, wherein the one or more attributes comprise one or more of a resource path, a query parameter, or a response status code.

### Claim 4 (depends on 1)

The method of claim 1, wherein the API traffic comprises API requests and responses to the API requests.

### Claim 5 (depends on 4)

The method of claim 4, wherein analyzing comprises analyzing the API requests and responses to the API requests.

### Claim 6 (depends on 4)

The method of claim 4, comprising determining whether a subsequent API request complies with the API specification generated.

### Claim 7 (depends on 6)

The method of claim 6, wherein determining comprises comparing an attribute of the subsequent API request to the one or more attributes identified.

### Claim 8 (depends on 1)

The method of claim 1, wherein the API specification generated includes one or more of an API description, one or more operations, resources paths, one or more resource items, query parameters or response codes.

### Claim 9

A system for generating an application program interface (API) specification, comprising:
one or more memories storing program instructions; and
one or more processing devices coupled to the one or more memories, the program instructions causing the one or more processing devices to:
receive API traffic communicated between one or more client devices and at least one backend system;
analyze the API traffic to identify one or more attributes associated with the API traffic, the one or more attributes comprising attributes associated with API requests and API responses corresponding to the API traffic that are determined to be valid; and
generate the API specification based on the one or more attributes identified as associated with one or more valid API requests.

### Claim 10 (depends on 9)

The system of claim 9, comprising the program instructions causing the one or more processing devices to update the API specification based on a change associated with the API traffic.

### Claim 11 (depends on 9)

The system of claim 9, wherein the one or more attributes comprise one or more of a resource path, a query parameter, or a response status code.

### Claim 12 (depends on 9)

The system of claim 9, wherein the API traffic comprises API requests and responses to the API requests.

### Claim 13 (depends on 12)

The system of claim 12, comprising the program instructions causing the one or more processing devices to analyze the API requests and responses to the API requests.

### Claim 14 (depends on 12)

The system of claim 12, comprising the program instructions causing the one or more processing devices to determine whether a subsequent API request complies with the API specification generated.

### Claim 15 (depends on 14)

The system of claim 14, wherein comprising the program instructions causing the one or more processing devices to determine by comparing an attribute of the subsequent API request to the one or more attributes identified.

### Claim 16 (depends on 9)

The system of claim 9, wherein the API specification generated includes one or more of an API description, one or more operations, resources paths, one or more resource items, query parameters or response codes.

### Claim 17 (depends on 1)

The method of claim 1, wherein the API specification allows for discovery of one or more services provided by the at least one backend system and instructions on how to instantiate the one or more services.

### Claim 18 (depends on 9)

The system of claim 9, wherein the API specification allows for discovery of one or more services provided by the at least one backend system and instructions on how to instantiate the one or more services.
