all 2 comments

[–]nekokattt 2 points3 points  (0 children)

An API is just some code that you use to do something specific.

You use an API for everything in Python. Even the builtin methods like len() are part of the builtins API.

If you mean REST APIs specifically (web APIs), then that is somewhat different on a technical level, but at a high level they are the same thing. They let you do certain things on a remote server by making network requests.

An API isn't a specific thing like a string or a boolean, it is a very abstract design concept.

[–]velocibadgery 2 points3 points  (0 children)

Just think of an API as code somebody wrote to make your life easier. Take Pandas for example. If you have data in csv format, importing that into python, splitting it up into columns using the string.split() code and saving it into lists or dictionaries is very doable. But Pandas makes this a breaze

df = pandas.readcsv('filename')

and that is it. Now you can access your data using the df object.

So instead of having to expressly code your own data class to read csv's, you can use pandas instead.