{"id":293741,"date":"2019-08-22T21:00:58","date_gmt":"2019-08-22T21:00:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293741"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293741","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c API \u043d\u0430 Python (\u0441 Flask \u0438 RapidAPI)"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ba3\/254\/0ba\/ba32540bab550e3f4f1f33db01f28d00.jpg\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 API (Application Programming Interface).<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 API, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438?<br \/>  <a name=\"habracut\"><\/a> <br \/>  \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442: \u043d\u0443\u0436\u043d\u043e <a href=\"https:\/\/blog.rapidapi.com\/20-tutorials-on-how-to-create-your-own-api-sorted-by-programming-language\/\">\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API<\/a>.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python.<\/p>\n<h3>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 API \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b:<\/p>\n<ul>\n<li>Python 3;<\/li>\n<li><a href=\"https:\/\/palletsprojects.com\/p\/flask\/\">Flask<\/a> \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u0435\u0433\u043a\u0438\u0439 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li><a href=\"https:\/\/flask-restful.readthedocs.io\/en\/latest\/\">Flask-RESTful<\/a> \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Flask, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c REST API \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439. <\/li>\n<\/ul>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"python\">pip install flask-restful<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p><b>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445:<\/b><br \/>  <a href=\"https:\/\/webinar.skillbox.ru\/csharp\/?utm_source=habr-com&amp;utm_medium=banners&amp;utm_campaign=all_all_habr-com_banners_banners_intensive-34_all_code_skillbox&amp;utm_content=2019-08-22\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 telegram-\u0431\u043e\u0442\u0430 \u043d\u0430 C#<\/a> \u2014 26\u201328 \u0430\u0432\u0433\u0443\u0441\u0442\u0430. <i>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u043e\u0442\u044b-\u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438, \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API Telegram \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043d\u044e\u0430\u043d\u0441\u0430\u0445. \u0422\u0440\u043e\u0435 \u043b\u0443\u0447\u0448\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u043e\u0442 Skillbox 30 000 \u0440\u0443\u0431\u043b\u0435\u0439<\/i>.  <\/p><\/blockquote>\n<p> <b>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c<\/b><\/p>\n<p>  \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c RESTful API \u0441 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 <a href=\"https:\/\/blog.rapidapi.com\/api-glossary\/crud\/\">CRUID-\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e<\/a>.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043d\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0434\u0432\u0443\u043c\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u043c\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <b>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 REST?<\/b><\/p>\n<p>  REST API (Representational State Transfer) \u2014 \u044d\u0442\u043e API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  REST API \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440: \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b, \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/li>\n<li>Stateless \u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0430\u043d\u0441\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/li>\n<li>\u041a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/li>\n<\/ul>\n<p>  <b>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CRUD?<\/b><\/p>\n<p>  <b>CRUD <\/b>\u2014 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (create, read, update \u0438 delete).<\/p>\n<p>  \u0412 REST API \u0442\u0438\u043f\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u0430\u043a post, get, put, delete.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e API.<\/p>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/h3>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0446\u0438\u0442\u0430\u0442 \u043e\u0431 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0435. \u0418\u0418 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0430 Python \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0418\u0418.<\/p>\n<p>  \u0421 \u044d\u0442\u0438\u043c API \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a Python \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0418\u0418 \u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0415\u0441\u043b\u0438 \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u0446\u0435\u043d\u043d\u044b\u0435 \u043c\u044b\u0441\u043b\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Flask:<\/p>\n<pre><code class=\"python\">from flask import Flask from flask_restful import Api, Resource, reqparse import random app = Flask(__name__) api = Api(app)<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u0435 Flask, Api \u0438 Resource \u2014 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p>  Reqparse \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Flask-RESTful\u2026 \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c random \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0446\u0438\u0442\u0430\u0442\u044b.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0446\u0438\u0442\u0430\u0442 \u043e\u0431 \u0418\u0418.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0435\u043f\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 ID;<\/li>\n<li>\u0438\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u0446\u0438\u0442\u0430\u0442\u044b;<\/li>\n<li>\u0446\u0438\u0442\u0430\u0442\u0443.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 Python. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0436\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">ai_quotes = [     {         \"id\": 0,         \"author\": \"Kevin Kelly\",         \"quote\": \"The business plans of the next 10,000 startups are easy to forecast: \" +                  \"Take X and add AI.\"     },     {         \"id\": 1,         \"author\": \"Stephen Hawking\",         \"quote\": \"The development of full artificial intelligence could \" +                  \"spell the end of the human race\u2026 \" +                  \"It would take off on its own, and re-design \" +                  \"itself at an ever increasing rate. \" +                  \"Humans, who are limited by slow biological evolution, \" +                  \"couldn't compete, and would be superseded.\"     },     {         \"id\": 2,         \"author\": \"Claude Shannon\",         \"quote\": \"I visualize a time when we will be to robots what \" +                  \"dogs are to humans, \" +                  \"and I\u2019m rooting for the machines.\"     },     {         \"id\": 3,         \"author\": \"Elon Musk\",         \"quote\": \"The pace of progress in artificial intelligence \" +                  \"(I\u2019m not referring to narrow AI) \" +                  \"is incredibly fast. Unless you have direct \" +                  \"exposure to groups like Deepmind, \" +                  \"you have no idea how fast \u2014 it is growing \" +                  \"at a pace close to exponential. \" +                  \"The risk of something seriously dangerous \" +                  \"happening is in the five-year timeframe.\" +                  \"10 years at most.\"     },     {         \"id\": 4,         \"author\": \"Geoffrey Hinton\",         \"quote\": \"I have always been convinced that the only way \" +                  \"to get artificial intelligence to work \" +                  \"is to do the computation in a way similar to the human brain. \" +                  \"That is the goal I have been pursuing. We are making progress, \" +                  \"though we still have lots to learn about \" +                  \"how the brain actually works.\"     },     {         \"id\": 5,         \"author\": \"Pedro Domingos\",         \"quote\": \"People worry that computers will \" +                  \"get too smart and take over the world, \" +                  \"but the real problem is that they're too stupid \" +                  \"and they've already taken over the world.\"     },     {         \"id\": 6,         \"author\": \"Alan Turing\",         \"quote\": \"It seems probable that once the machine thinking \" +                  \"method had started, it would not take long \" +                  \"to outstrip our feeble powers\u2026 \" +                  \"They would be able to converse \" +                  \"with each other to sharpen their wits. \" +                  \"At some stage therefore, we should \" +                  \"have to expect the machines to take control.\"     },     {         \"id\": 7,         \"author\": \"Ray Kurzweil\",         \"quote\": \"Artificial intelligence will reach \" +                  \"human levels by around 2029. \" +                  \"Follow that out further to, say, 2045, \" +                  \"we will have multiplied the intelligence, \" +                  \"the human biological machine intelligence \" +                  \"of our civilization a billion-fold.\"     },     {         \"id\": 8,         \"author\": \"Sebastian Thrun\",         \"quote\": \"Nobody phrases it this way, but I think \" +                  \"that artificial intelligence \" +                  \"is almost a humanities discipline. It's really an attempt \" +                  \"to understand human intelligence and human cognition.\"     },     {         \"id\": 9,         \"author\": \"Andrew Ng\",         \"quote\": \"We're making this analogy that AI is the new electricity.\" +                  \"Electricity transformed industries: agriculture, \" +                  \"transportation, communication, manufacturing.\"     } ]<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Quote, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e API. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u044f\u0432\u0438\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430: get, post, put, delete.<\/p>\n<p>  <b>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043c\u0435\u0442\u043e\u0434\u0430 GET<\/b><\/p>\n<p>  \u041e\u043d \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443 \u043f\u0443\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0435\u0435 ID \u0438\u043b\u0438 \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443, \u0435\u0441\u043b\u0438 ID \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d.<\/p>\n<pre><code class=\"python\">class Quote(Resource):     def get(self, id=0):         if id == 0:             return random.choice(ai_quotes), 200         for quote in ai_quotes:             if(quote[\"id\"] == id):                 return quote, 200         return \"Quote not found\", 404<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 GET \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443, \u0435\u0441\u043b\u0438 ID \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442.\u0435. \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 ID \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u0434\u0430\u043d.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043e\u043d \u0437\u0430\u0434\u0430\u043d, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0438\u0449\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u0446\u0438\u0442\u0430\u0442 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 ID. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u201cQuote not found, 404\u201d.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435: \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 HTTP-\u0441\u0442\u0430\u0442\u0443\u0441 200 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 404, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c POST-\u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0446\u0438\u0442\u0430\u0442\u044b \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/p>\n<p>  \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0446\u0438\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, POST \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c reqparse \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0434\u0442\u0438 \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0430\u0432\u0442\u043e\u0440 \u0438 \u0442\u0435\u043a\u0441\u0442 \u0446\u0438\u0442\u0430\u0442\u044b).<\/p>\n<pre><code class=\"python\">def post(self, id):       parser = reqparse.RequestParser()       parser.add_argument(\"author\")       parser.add_argument(\"quote\")       params = parser.parse_args()       for quote in ai_quotes:           if(id == quote[\"id\"]):               return f\"Quote with id {id} already exists\", 400       quote = {           \"id\": int(id),           \"author\": params[\"author\"],           \"quote\": params[\"quote\"]       }       ai_quotes.append(quote)       return quote, 201<\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0432\u044b\u0448\u0435 POST-\u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u044f\u043b ID \u0446\u0438\u0442\u0430\u0442\u044b. \u0417\u0430\u0442\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f reqparse, \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0430\u0432\u0442\u043e\u0440\u0430 \u0438 \u0446\u0438\u0442\u0430\u0442\u0443 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0438\u0445 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 params.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0446\u0438\u0442\u0430\u0442\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c ID \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u0434 400.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0446\u0438\u0442\u0430\u0442\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c ID \u0435\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c ID \u0438 \u0430\u0432\u0442\u043e\u0440\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a ai_quotes \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u043d\u043e\u0432\u043e\u0439 \u0446\u0438\u0442\u0430\u0442\u043e\u0439 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c 201.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u043c PUT-\u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0446\u0438\u0442\u0430\u0442\u044b \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<pre><code class=\"python\">def put(self, id):       parser = reqparse.RequestParser()       parser.add_argument(\"author\")       parser.add_argument(\"quote\")       params = parser.parse_args()       for quote in ai_quotes:           if(id == quote[\"id\"]):               quote[\"author\"] = params[\"author\"]               quote[\"quote\"] = params[\"quote\"]               return quote, 200              quote = {           \"id\": id,           \"author\": params[\"author\"],           \"quote\": params[\"quote\"]       }              ai_quotes.append(quote)       return quote, 201<\/code><\/pre>\n<p>  PUT-\u043c\u0435\u0442\u043e\u0434, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0431\u0435\u0440\u0435\u0442 ID \u0438 input \u0438 \u043f\u0430\u0440\u0441\u0438\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0438\u0442\u0430\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f reqparse.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0446\u0438\u0442\u0430\u0442\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c ID \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u043d\u043e\u0432\u0438\u0442 \u0435\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c 200. \u0415\u0441\u043b\u0438 \u0446\u0438\u0442\u0430\u0442\u044b \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c ID \u0435\u0449\u0435 \u043d\u0435\u0442, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u043a\u043e\u0434\u043e\u043c 201.<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c DELETE-\u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0446\u0438\u0442\u0430\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u043d\u0435 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u0435\u0442<\/p>\n<pre><code class=\"python\">def delete(self, id):       global ai_quotes       ai_quotes = [qoute for qoute in ai_quotes if qoute[\"id\"] != id]       return f\"Quote with id {id} is deleted.\", 200<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 ID \u0446\u0438\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a ai_quotes, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c resource \u043a API, \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Flask.<\/p>\n<pre><code class=\"python\">api.add_resource(Quote, \"\/ai-quotes\", \"\/ai-quotes\/\", \"\/ai-quotes\/&lt;int:id&gt;\") if __name__ == '__main__':     app.run(debug=True)<\/code><\/pre>\n<p>  \u041d\u0430\u0448 REST API Service \u0433\u043e\u0442\u043e\u0432!<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b app.py, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"python\">python3 app.py<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435\u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n<p>  <i>* Debug mode: on<br \/>  * Running on <a href=\"http:\/\/127.0.0.1\">127.0.0.1<\/a>:5000\/ (Press CTRL+C to quit)<br \/>  * Restarting with stat<br \/>  * Debugger is active!<br \/>  * Debugger PIN: XXXXXXX<\/i><\/p>\n<p>  <b>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c API<\/b><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a API \u0441\u043e\u0437\u0434\u0430\u043d, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b curl \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Insomnia REST \u043b\u0438\u0431\u043e \u0436\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0432 API \u043d\u0430 Rapid API.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/07d\/0ba\/ac3\/07d0baac377bd2cd2667b7c457740e64.png\"><\/p>\n<p>  <b>\u041f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043d\u0430\u0448 API<\/b><\/p>\n<p>  RapidAPI \u2014 \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432 \u043c\u0438\u0440\u0435 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441 \u0441 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 10 000 API (\u0438 \u043e\u043a\u043e\u043b\u043e 1 \u043c\u043b\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432).<\/p>\n<p>  RapidAPI \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 API, \u043d\u043e \u0438 \u0434\u0430t\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b <a href=\"https:\/\/rapidapi.com\/api-providers\">\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e<\/a>, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432 \u0441\u0435\u0442\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/www.heroku.com\/\">Heroku<\/a>. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0438\u043c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, (<a href=\"https:\/\/devcenter.heroku.com\/articles\/getting-started-with-python\">\u0443\u0437\u043d\u0430\u0442\u044c \u043e \u043d\u0451\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<p>  <b>\u041a\u0430\u043a \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 API \u043d\u0430 Heroku<\/b><\/p>\n<p>  <i><b>1. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Heroku.<\/b><\/i><\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Heroku Command Line Interface (CLI). \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Ubuntu 16+.<\/p>\n<p>  <i>sudo snap install heroku &#8212;classic<\/i><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043b\u043e\u0433\u0438\u043d\u0438\u043c\u0441\u044f:<\/p>\n<p>  <i>heroku login<\/i><\/p>\n<p>  <i><b>2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/b><\/i><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<ul>\n<li>requirements.txt \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 Python \u043c\u043e\u0434\u0443\u043b\u0435\u0439;<\/li>\n<li>Procfile, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/li>\n<li>.gitignore \u2014 \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/li>\n<\/ul>\n<p>  \u0424\u0430\u0439\u043b requirements.txt \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<ul>\n<li>flask<\/li>\n<li>flask-restful<\/li>\n<li>gunicorn<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 gunicorn (Python WSGI HTTP Server) \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>  Procfile \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c:<\/p>\n<p>  <i>web: gunicorn app:app<\/i><\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 .gitignore:<\/p>\n<pre><code class=\"1c\">*.pyc __pycache__\/<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0444\u0430\u0439\u043b\u044b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c git-\u0440\u0435\u043f\u043e \u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043c:<\/p>\n<pre><code class=\"plaintext\">git init git add git commit -m \"First API commit\"<\/code><\/pre>\n<p>  <i><b>3. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 Heroku-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/b><\/i><\/p>\n<pre><code class=\"plaintext\">heroku create<\/code><\/pre>\n<p>  \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c master branch \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u043f\u043e Heroku:<\/p>\n<pre><code class=\"plaintext\">git push heroku master<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 API Service \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"plaintext\">heroku ps:scale web=1 heroku open  <\/code><\/pre>\n<p>  API \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"https:\/\/your-random-heroku-name.herokuapp.com\/ai-quotes\/\">your-random-heroku-name.herokuapp.com\/ai-quotes<\/a>.<\/p>\n<p>  <b>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u0448 Python API \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441 RapidAPI<\/b><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a API-\u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 Heroku, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043a Rapid API. \u0417\u0434\u0435\u0441\u044c <a href=\"https:\/\/docs.rapidapi.com\/docs\/getting-started\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435.<\/p>\n<p>  <i><b>1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 RapidAPI.<\/b><\/i> <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f3a\/35d\/013\/f3a35d01372d9c998e7508a59b9a7d69.png\"><\/p>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u2014 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Facebook, Google, GitHub. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4be\/9c2\/c7d\/4be9c2c7da982571aa16f7e715784409.png\"><\/p>\n<p>  <i><b>2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c API \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b38\/733\/cc5\/b38733cc584694eabd37b360a44d42ea.png\"><\/p>\n<p>  <i><b>3. \u0414\u0430\u043b\u0435\u0435 \u0432\u0432\u043e\u0434\u0438\u043c \u043e\u0431\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0435\u043c API.<\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/414\/804\/fd7\/414804fd7b343aeb691fed695f16e392.png\"><\/p>\n<p>  <i><b>4. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u201cAdd API\u201d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0448\u0435\u043c API.<\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b39\/9dd\/c4d\/b399ddc4d329fab9e95cf77f34dbd583.png\"><\/p>\n<p>  <i><b>5. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u0432\u0435\u0441\u0442\u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b API, \u043b\u0438\u0431\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c <a href=\"https:\/\/blog.rapidapi.com\/whats-new-at-rapidapi-added-features-and-updates-july-2019\/\">swagger-file<\/a> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 OpenAPI.<\/b><\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3f7\/1e6\/950\/3f71e695060c691e115bc4c54b9f08d8.png\"><\/p>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e API \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 Endpoints. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 CRUD (get, post, put, delete).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/42a\/c79\/eb7\/42ac79eb7ba7699e71d93bf79030d0b6.png\"><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 GET AI Quote, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0446\u0438\u0442\u0430\u0442\u0443 (\u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 ID \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439) \u0438\u043b\u0438 \u0446\u0438\u0442\u0430\u0442\u0443 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e ID.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u201cCreate Endpoint\u201d.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a7b\/82b\/ef1\/a7b82bef117a91a931584c6c07c63a89.png\"><\/p>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 API. \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451! \u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u0432\u0430\u0448 API!<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 API \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/83e\/14e\/200\/83e14e2002bd3a6b85148557c79cb050.png\"><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e RESTful API Service \u043d\u0430 Python, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 API \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Heroku \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 RapidAPI.<\/p>\n<p>  \u041d\u043e \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 API \u2014 \u0442\u0430\u043a\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b, \u043a\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e API \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillbox\/blog\/464705\/\"> https:\/\/habr.com\/ru\/company\/skillbox\/blog\/464705\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ba3\/254\/0ba\/ba32540bab550e3f4f1f33db01f28d00.jpg\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 API (Application Programming Interface).<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 API, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-293741","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293741"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293741\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}