How to use the API to query the knowledge base? #4740
Replies: 4 comments 6 replies
-
To query the content and related information of an article by the article name, database ID, or article ID using the API, you can use the Get Document List endpoint. Here is how you can do it: curl --location --request GET 'https://api.dify.ai/v1/datasets/{dataset_id}/documents' \
--header 'Authorization: Bearer {api_key}' Replace Additionally, if you are working with PubMed articles, you can use the from pubmed_search import PubMedAPIWrapper
# Initialize the PubMed API Wrapper
pubmed_api = PubMedAPIWrapper(email="[email protected]")
# Run a search query
query = "your search query"
result = pubmed_api.run(query)
print(result) This will return the document summaries of the top-k results for the given search query. The
|
Beta Was this translation helpful? Give feedback.
-
+1, raised a similar issue, and has been put into discussion with no reply... |
Beta Was this translation helpful? Give feedback.
-
Would love to see the knowledge search endpoint implemented. This is going to be a huge help with integrating dify to other systems. |
Beta Was this translation helpful? Give feedback.
-
Is there an API endpoint that can be used to get the metadata of a document that we have uploaded onto dify |
Beta Was this translation helpful? Give feedback.
-
Self Checks
Provide a description of requested docs changes
I hope to operate the knowledge base through the API and use it within the workflow. However, I've noticed that only the API for managing the knowledge base has been released so far. Is there any way to query the content and related information of an article by the article name, database ID, or article ID?
Beta Was this translation helpful? Give feedback.
All reactions