6 Easy Tips to Design an AWESOME REST API

6 Easy Tips to Design an AWESOME REST API

ArjanCodes

7 месяцев назад

37,388 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@KeithFlint350
@KeithFlint350 - 19.07.2024 18:05

I'm looking forward to see more videos about the design. Like general concepts. I learn all programming by myself and after a short period of time I realise, that I'm developing a Frankenstein that's gonna eat me in a while. I build mess 😂

Ответить
@rednax25
@rednax25 - 19.07.2024 18:31

This video came at just the right moment. Preparing some API s for a system, these tips will be implemented immediately. Thanks Arjan.

Ответить
@CollinHeist20
@CollinHeist20 - 19.07.2024 18:41

This was just an excuse to bash the PayPal API, wasn't it🤣

Ответить
@glorytoarstotzka330
@glorytoarstotzka330 - 19.07.2024 18:51

not a great thumbnail

Ответить
@sofianeabdellaoui3682
@sofianeabdellaoui3682 - 19.07.2024 18:55

I never actually succeeded to do anything in SQLAlchemy from their documentation 😅

Ответить
@aliriano15
@aliriano15 - 19.07.2024 18:59

Always looking forward to Friday 17 CET

Ответить
@acmethunder
@acmethunder - 19.07.2024 19:08

Standards and Easy integration are probably the most important. For example, if an API is going to accept a standardized data format (like JSON), FOLLOW THE SPEC!! (Authorize Net, I'm looking at you!!)

Ответить
@Cohnan13
@Cohnan13 - 19.07.2024 19:09

You read my mind. I had been thinking about finding resources on what a good API should be

Ответить
@CharlesFourneau
@CharlesFourneau - 19.07.2024 19:13

APIRoast 🔥

Ответить
@rafaelagd0
@rafaelagd0 - 19.07.2024 19:28

Excelente tips!
👏👏👏👏👏

Ответить
@x7A9cF2k
@x7A9cF2k - 19.07.2024 20:18

Hi Arjan, your videos are as always precise and insightful.
I have a question: I am currently doing a project that requires at the end of the execution to push 20-25K rows of data mssql server (on premise). I used sql alchemy, was bit slower. later I used pyodbc, bit faster. Now approx. it takes 3 minutes to push 4k rows. My data has 20 columns, including int, varchar, and bit types.

Would you suggest something, that could make the pushing faster, maybe each time with a chunks of 100-150 rows?

Ответить
@sebastiannarvaez2450
@sebastiannarvaez2450 - 19.07.2024 20:19

We need a video to learn how to develop the SDK, please

Ответить
@roberttaylor7732
@roberttaylor7732 - 19.07.2024 20:43

Thanks! This is was great coverage of the subject.

Ответить
@vgrigori
@vgrigori - 19.07.2024 21:02

@ArjanCodes Thanks for the video. I have two questions: 1. What do you think about swagger for api documentation?
2. How do you like to use POST instead of GET in case of multiple search filters?

Ответить
@btcroston1
@btcroston1 - 19.07.2024 21:19

What about making a test framework / sandbox for unit testing your API?

Ответить
@RandomHammy
@RandomHammy - 19.07.2024 21:33

Anyone watching this video, ignore all of Arjan's comments on Paypal's use of ISO-8601 datetime format. That is a financial and developer centric API, so it requires arguments to be *as accurate as possible*. The use of the ISO format:
- Guarantees an international standard
- Guarantees easy datetime parsing and construction in almost all modern programming languages (python is one of the few oddballs that didn't follow international standards on datetime strings for some daft reason)
- Guarantees cross time zone accuracy

While Arjan is correct in saying arguments in APIs should be simple and easy to use, this is one of the worst examples to give! Datetimes in financial transactions are just one of those things where accuracy is a pivotal Functional Requirement

Ответить
@ulfjohansen2139
@ulfjohansen2139 - 19.07.2024 21:49

The fact that you write applications that don't care about proper representation of time is just an admission that you don't actually work in the real world. Using anything other than a proper standard representation of time in a api that is used globally would be crazy. Somtimes things are not as simple as it is with your hobby projects.

Ответить
@AloisMahdal
@AloisMahdal - 19.07.2024 21:54

re: datetimes and "Internet Time", datetimes are tricky but are you proposing to use something else than iso8601? Or is your point just that they weren't clear about which format?

I suppose "Internet Time" is not common, it did not ring a bell to me, but ISO 8601 would immediately :D. Personally I lean towards thinking that UNIX timestamps are the easiest, on the other hand I have never really confirmed this. (ISO 8601 has the advantage that you can understand or write it---if you're nerdy enough--by hand.)

Ответить
@hriscuvalerica4814
@hriscuvalerica4814 - 19.07.2024 23:11

Great video ! But clearly you didn't design your api to handle a couple of trillion concurrent requests ! What is this ?!? Amateur hour ?

Ответить
@_DRMR_
@_DRMR_ - 19.07.2024 23:43

Apparently there is `sqlalchemy-json` project that adds mutation-tracked json types.

Ответить
@yickysan
@yickysan - 20.07.2024 00:08

I know private methods isn't a really python thing but I would have used the _ naming convention for methods I'll use only inside the class.

Ответить
@abhishekpawar921
@abhishekpawar921 - 20.07.2024 12:05

Very insightful video!

Ответить
@sambroderick5156
@sambroderick5156 - 20.07.2024 13:03

The time/date standards are complicated but are handled in the base library in Python plus additional packages (probably the same for js). There are a lot of transactions so requiring seconds is probably a performance issue.

Ответить
@bobdowling6932
@bobdowling6932 - 20.07.2024 22:53

PayPal documents that it has a delay of up to three hours between something being entered and appearing in the search results. You don’t mention the other handlers. Do they explicitly say the response is instant (or has some shorter period)? Or are you assuming that their lack of statement means that it is immediate? Have you tested them? Are you truly this naïve?

Ответить
@Nalewkarz
@Nalewkarz - 21.07.2024 00:29

Hmmm.. I didn't get the part with adding ids of related object. Isn't that obvious that You should provide only needed data (it means that related objects will be usefull only for chosen use cases) ? And then, when it's needed You can always return not only ids but also aggregate (more detailed information about related objects) . Input and output serializers (or input and output dto's) are also next big thing You missed. I liked that you showed real API's examples.

Ответить
@jake115577
@jake115577 - 21.07.2024 15:20

Thanks, Arjan!

Ответить
@therealjohnshelburne
@therealjohnshelburne - 21.07.2024 20:20

You’re a legend! Pointing out which APIs are great vs. sht is so helpful

Ответить
@therealjohnshelburne
@therealjohnshelburne - 21.07.2024 20:32

Stupid Question- what is difference between documentation and SDK?

Ответить
@oncedidactic
@oncedidactic - 21.07.2024 20:50

I can see why PayPal API would be intentionally designed to force use of fully granular arguments re: datetime (including seconds and timezone). It's an interesting pivot point here between "keep it simple" and "use obvious default behavior" vs safeguard the user against dumb logic errors especially where there are possible gotchas. (How you handle datetimes is a classic source of headache.)

But this actually serves your broader point -- it should ALWAYS be as simple as possible. There should be a good reason why it's not as simple as you might think at first. And that reasoning should be explained well, and made obvious through example code. AKA "as simple as possible" might not mean "as easy as the novice thinks of it", and the required complexity then needs to be surfaced directly.

Ответить
@PhunkyBob
@PhunkyBob - 21.07.2024 22:03

I see a lot of sites providing a panel with example for various languages (cURL, Python, JS, ...) as input and corresponding result for every endpoints.
Is there a way to generate this panels automatically?

Ответить
@not_a_human_being
@not_a_human_being - 22.07.2024 19:07

While that all nice and dandy, I have a felling that some basic CRUD must be "out-of-the-box" experience.. like plug in your custom functions here and there and get an API (is there a package like that? gotta be somewhere..), at least for CRUD on objects that customer "owns".

Ответить
@PaulFWatts
@PaulFWatts - 27.07.2024 23:54

Thanks for the video. I enjoyed it !

Ответить
@GamersOutcast
@GamersOutcast - 28.07.2024 17:36

Quickly becoming the best coding channel. $10 for pro is too little I think its worth more than that. You should add supporter their for more than 10 I would get it in a heartbeat the value is already there.

Ответить
@soklagenhet
@soklagenhet - 02.08.2024 18:34

It would be interesting if you created a video or course about structuring a fastapi application. E.g, how would you structure the endpoints (model-focused? domain focused?), how would you handle business logic?

Ответить
@amadzarak7746
@amadzarak7746 - 03.08.2024 20:13

Thanks Arjan!

Ответить
@Neejoh
@Neejoh - 12.08.2024 23:07

I think you use “Mea culpa” wrong Arjan. Look it up.
Video is good info though, even for when you don’t write Python.

Ответить
@adrianojordao4634
@adrianojordao4634 - 13.08.2024 14:15

I like your channel, the content and your preesentation and talking. Its a lovely channel. But the pictures before you click the video, are terrible. Really really bad. Please improve that, a litle bit more classy ;)

Ответить
@Andrumen01
@Andrumen01 - 17.09.2024 14:31

Throughout the years I have found that the use of any pattern/technique/solution/method/etc., is using it in the right context. That is, use common sense, that is what people lack (including coders and programmers!)

You don't have to use a bulldozer to dig a 1 meter deep hole, you can use a shovel and it will work like a charm. But if you expect do dig a foundation with a shovel it will take forever! Use the right tool for the right context!

Ответить
@DrGreenGiant
@DrGreenGiant - 30.11.2024 11:53

The naming of a member function "dict" made me shudder in the shadows.
Really useful video though. I've been trying to wrap my head around how to make an api for a complex embedded sensor with an existing code base.
Not sure if this is something you can help out with in general; adding an API to an existing project which is normally configured by a config file (or ENV) that only gets read on startup.
Cheers!

Ответить
@savaok255
@savaok255 - 05.03.2025 04:35

god bless you Arjan. thanks a lot for your work.

Ответить