Abstract:API-related knowledge is usually scattered among multiple information sources, such as API reference documentation, Q&A forum and other unstructured texts, which is not conducive to API query and retrieval. To improve the efficiency of API retrieval, this study proposes an API knowledge graph construction method based on multi-source information fusion. API reference documentation describes the function and structure of the API from a designer’s perspective, while Stack Overflow provides the purpose and use scenarios of the API from a user’s perspective. API reference documentation and Stack Overflow complement each other, and they can provide support for API query and retrieval together. By means of analyzing API reference documentation, API and domain concepts can be extracted as entities and their relationships can be constructed. With the Stack Overflow website, Q&A and API concepts can be extracted as entities and their relationships can also be constructed. On this basis, these two kinds of information are fused to construct a multi-source API knowledge graph for the API recommendation based on the knowledge graph. To verify the proposed method, this study evaluates the effectiveness of the API knowledge graph in terms of the accuracy of knowledge extraction and the API recommendation. The experimental results show that the recommendation effectiveness and efficiency based on our knowledge graph have been improved.