-3

I'm a newbie in using API. I just want to get the data from API and store it in a database. I know there are many libraries/packages in python to extract the data from specific API (for example Google API: google-api-python-client). So is there any generic library to get the data from API?

Thank you

11
  • 1
    It depends on the format of the data. If it's a RESTful JSON API, you can use requests to get the data, and json to convert it to a Python dict Commented Oct 9, 2019 at 10:41
  • I have read the second point multiple times. Can you please reword it? I am not able to understand your model. Commented Oct 9, 2019 at 10:41
  • Agreed @WinningAddicted - I can't understand the second point in the OP... Commented Oct 9, 2019 at 10:48
  • @WinningAddicted It's my bad. I didn't have a proper understanding of what Redirect URL is. I've edited my question. Thanks Commented Oct 9, 2019 at 10:52
  • @NihalMudhiraj Good to know :) If there are no mode doubts, can you please close the question? Commented Oct 9, 2019 at 10:54

1 Answer 1

0

When you are trying to use a generic API service, inherently that means you want a library that can help you do the following:

(Assuming they are RESTful APIs):

  1. POST requests
  2. GET requests
  3. PUT requests

All you need is the requests module that fits the bill: https://pypi.org/project/requests/

Tutorial to use it: https://www.w3schools.com/python/module_requests.asp

For the second part, I am confused about what you exactly want to do. Do you want anyone to view some data if the have the URL to it? I can update my answer based on your inputs.

Sign up to request clarification or add additional context in comments.

3 Comments

This discusses only one type of application programming interface (API). There are many different APIs, and new APIs are constantly added. There cannot be a generic API library.
@JoachimWagner I think I gotta read more about API. Thanks a lot for your answer :)
@NihalMudhiraj Lot's of interesting blog posts when searching for history of api.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.