grobid
grobid copied to clipboard
how to call the api from my web app
how do i call an API, like what, or how do i write the API URL to call for the GROBID service so that it process my headerdocument send me back the Json file.
well i have read the documentation, but what i want is an example of how you can call for a service... for example if am working on a web app no my local machine and i have GROBID service running, how to i tell the grobid service all i want it to do for me....in an URL....example (localhost:8070/api/......what do i put there. ) if want it to process the headerInformation and send the out put to the web app in JSON format.. thanks.
documentation of the Web API with examples: https://grobid.readthedocs.io/en/latest/Grobid-service/#grobid-web-services
3 reference client implementations: https://grobid.readthedocs.io/en/latest/Grobid-service/#clients-for-grobid-web-services
@Victor-Mwelwa I was recently working on GROBID and to use it more efficiently came up with this solution which can be used.
import requests
# GROBID_URL = 'http://localhost:8070' #if you wish to use service running in your local
GROBID_URL = 'https://cloud.science-miner.com/grobid/'
url = '%s/api/processFulltextDocument' % GROBID_URL
xml = requests.post(url, files={'input': open(filename, 'rb')}).text