{"id":2427,"date":"2018-12-16T14:21:32","date_gmt":"2018-12-16T14:21:32","guid":{"rendered":"http:\/\/intelligentonlinetools.com\/blog\/?p=2427"},"modified":"2018-12-18T00:15:25","modified_gmt":"2018-12-18T00:15:25","slug":"integrating-sentiment-analysis-api-python-django-web-application","status":"publish","type":"post","link":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/","title":{"rendered":"Integrating Sentiment Analysis API Python Django into Web Application"},"content":{"rendered":"<p>In this post we will learn how to use <b>sentiment analysis with API python<\/b> from paralleldots.com.  We will look at running this API from python environment on laptop and also in web application environment with python <b>Django<\/b> on pythonanywhere hosting site.  <\/p>\n<p>In the one of previous <a href=\"https:\/\/ai.intelligentonlinetools.com\/ml\/how-to-create-a-chatbot-with-chatbot-open-source\/\" target=\"_blank\">post<\/a> we set python Django project for chatbot. Here we will add file to this environment. Setting the chatbot files from previous project is not necessary. We just need folder structure.<\/p>\n<p>Thus in this post we will reuse and extend some python Django knowledge that we got in the previous post. We will learn how to pass parameters from user form to server and back to user form, how to serve images, how to have logic block in web template.<\/p>\n<p><img data-attachment-id=\"2436\" data-permalink=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/neural-network-3637503_640\/#main\" data-orig-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-e1544973390491.png\" data-orig-size=\"540,304\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"neural-network-3637503_640\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-300x169.png\" data-large-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-e1544973390491.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-e1544973390491.png\" alt=\"\" width=\"540\" height=\"304\" class=\"alignnone size-full wp-image-2436\" \/><\/p>\n<p><b>ParrallelDots<\/b> [1] provides several machine learning APIs such as named entity recognition (NER), intent identification, text classification and sentiment analysis. In this post we will explore sentiment analysis API and how it can be deployed on web server with Diango python.<\/p>\n<h2>Running Text Analysis API Locally<\/h2>\n<p>First we need install the library:<br \/>\npip install paralleldots<\/p>\n<p>We need also obtain key. It is free and no credit card required.<\/p>\n<p>Now we run code as below<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport paralleldots\r\nparalleldots.set_api_key(&quot;XXXXXXXXXXX&quot;)\r\n\r\n# for single sentence\r\ntext=&quot;the day is very nice&quot;\r\nlang_code=&quot;en&quot;\r\nresponse=paralleldots.sentiment(text,lang_code)\r\n\r\nprint(response)\r\nprint (response['sentiment'])\r\nprint (response['code'])\r\nprint (response['probabilities']['positive'])\r\nprint (response['probabilities']['negative'])\r\nprint (response['probabilities']['neutral'])\r\n\r\n\r\n# for multiple sentence as array\r\ntext=[&quot;the day is very nice,the day is very good,this is the best day&quot;]\r\nresponse=paralleldots.batch_sentiment(text)\r\nprint(response)\r\n\r\nOutput:\r\n{'probabilities': {'negative': 0.001, 'neutral': 0.002, 'positive': 0.997}, 'sentiment': 'positive', 'code': 200}\r\npositive\r\n200\r\n0.997\r\n0.001\r\n0.002\r\n{'sentiment': [{'negative': 0.0, 'neutral': 0.001, 'positive': 0.999}], 'code': 200}\r\n<\/pre>\n<p>This is very simple. Now we will deploy on web hosting site with python Django. <\/p>\n<h2>Deploying API on Web Hosting Site<\/h2>\n<p>Here we will build web form. Using this web form user can enter some text which will be passed to semantic analysis API. The result of analysis will be passed back to user and image will be shown based on result of sentiment analysis.<br \/>\nFirst we need install paralleldots library.  To install the paralleldots module for Python 3.6, we&#8217;d run this in a Bash console (not in a Python one):  [2]<br \/>\npip3.6 install &#8211;user paralleldots<\/p>\n<p>Note it is two dashes before user.<br \/>\nNow create or update the following files:<\/p>\n<p><b>views.py<\/b><\/p>\n<p>In this file we are getting user input from web form and sending it to API. Based on sentiment output from API we select image filename.   <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom django.shortcuts import render\r\n\r\nimport paralleldots\r\n\r\ndef do_sentiment_analysis(request):\r\n    user_sent=&quot;&quot;\r\n    user_input=&quot;&quot;\r\n    fname=&quot;na&quot;\r\n    if request.POST:\r\n       user_input=request.POST.get('user_input', '')\r\n       lang_code=&quot;en&quot;\r\n       paralleldots.set_api_key(&quot;XXXXXXXXX&quot;)\r\n       user_response=paralleldots.sentiment(user_input,lang_code)\r\n       user_sent=user_response['sentiment']\r\n\r\n       if (user_sent == 'neutral'):\r\n             fname=  &quot;emoticon-1634586_640.png&quot;\r\n       elif (user_sent == 'negative'):\r\n             fname = &quot;emoticon-1634515_640.png&quot;\r\n       elif (user_sent == 'positive'):\r\n             fname = &quot;smiley-163510_640.jpg&quot;\r\n       else:\r\n             fname=&quot;na&quot;\r\n\r\n    return render(request, 'my_template_img.html', {'resp': user_sent, 'fname':fname, 'user_input':user_input})\r\n<\/pre>\n<p><b>my_template_img.html<\/b><br \/>\nCreate new file   my_template_img.html   This file will have web input form for user to enter some text. We have also if statement here because we do not want display image when the form is just opened and no submission is done.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&lt;html&gt;\r\n&lt;form method=&quot;post&quot;&gt;\r\n    {% csrf_token %}\r\n\r\n    &lt;textarea rows=10 cols=50 name=&quot;user_input&quot;&gt;{{user_input}}&lt;\/textarea&gt;\r\n    &lt;br&gt;\r\n    &lt;label&gt;{{resp}}&lt;\/label&gt;\r\n    &lt;br&gt;\r\n    &lt;button type=&quot;submit&quot;&gt;Submit&lt;\/button&gt;\r\n\r\n\r\n  {% if &quot;_640&quot; in fname %}\r\n     &lt;img src=&quot;\/media\/{{fname}}&quot; width=&quot;140px&quot; height=&quot;100px&quot;&gt;\r\n  {% endif %}\r\n&lt;\/form&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><b>Media folder<\/b><br \/>\nIn the media folder download images to represent negative, neutral and positive. We can find images on pixabay site. <\/p>\n<p>So the folder can look like this. Note if we use different file names we will need adjust the code.  <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n emoticon-1634515_640.png\r\n emoticon-1634586_640.png\r\n smiley-163510_640.jpg\r\n \t\t\r\n \r\n<\/pre>\n<p><b>urls.py<\/b><br \/>\nThis file is located under \/home\/username\/projectname\/projectname.  Add import line to this file and also include pattern for do_sentiment_analysis:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom views import do_sentiment_analysis\r\n\r\nurlpatterns = [\r\n \r\nurl(r'^press_my_buttons\/$', press_my_buttons),\r\nurl(r'^do_sentiment_analysis\/$', do_sentiment_analysis),\r\n\r\n]\r\n<\/pre>\n<p><b>settings.py<\/b>  <\/p>\n<p>This file is also located under \/home\/username\/projectname\/projectname<br \/>\nMake sure it has the following<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nSTATIC_URL = '\/static\/'\r\n\r\nMEDIA_ROOT = u'\/home\/username\/projectname\/media'\r\nMEDIA_URL = '\/media\/'\r\n\r\nSTATIC_ROOT = u'\/home\/username\/projectname\/static'\r\nSTATIC_URL = '\/static\/'\r\n<\/pre>\n<p>Now when all is set, just access link. In case we use pythonanywhere  it will be: http:\/\/username.pythonanywhere.com\/do_sentiment_analysis\/ <\/p>\n<p>Enter some text into text box and click Submit. We will see the output of API for sentiment analysis result and image based on this sentiment. Below are some screenshots.<br \/>\n<img data-attachment-id=\"2443\" data-permalink=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/screenshots_from_sentiment_analysis_api_testing\/#main\" data-orig-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/screenshots_from_sentiment_analysis_API_testing-e1545009465212.png\" data-orig-size=\"600,460\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"screenshots_from_sentiment_analysis_API_testing\" data-image-description=\"&lt;p&gt;screenshots from sentiment analysis API testing&lt;\/p&gt;\n\" data-image-caption=\"\" data-medium-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/screenshots_from_sentiment_analysis_API_testing-300x230.png\" data-large-file=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/screenshots_from_sentiment_analysis_API_testing-e1545009465212.png\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/screenshots_from_sentiment_analysis_API_testing-e1545009465212.png\" alt=\"\" width=\"600\" height=\"460\" class=\"alignnone size-full wp-image-2443\" \/><\/p>\n<p><strong>Conclusion<\/strong><br \/>\nWe integrated machine learning sentiment analysis API from parallelDots into our python Diango web environment. We built web user input form that can send data to this API and receive output from API to show it to user. While building this we learned some Django things:<br \/>\nhow to pass parameters from user form to server and back to user form,<br \/>\nhow to serve images,<br \/>\nhow to have logic block in web template.<br \/>\nWe can build now different web applications that would use API service from ParallelDots.  And we are able now  integrate emotion analysis from text into our website. <\/p>\n<p><strong>References<\/strong><\/p>\n<p><a href=\"https:\/\/www.paralleldots.com\/\" target=\"_blank\">ParallelDots<\/a><br \/>\n<a href=\"https:\/\/help.pythonanywhere.com\/pages\/InstallingNewModules\/\" target=\"_blank\">Installing New Modules<\/a><br \/>\n<a href=\"https:\/\/overiq.com\/django-1-10\/handling-media-files-in-django\/\" target=\"_blank\">Handling Media Files in Django<br \/>\n<a href=\"https:\/\/djangobook.com\/\" target=\"_blank\">Django Book<\/a><br \/>\n<a href=https:\/\/ai.intelligentonlinetools.com\/ml\/how-to-create-a-chatbot-with-chatbot-open-source\/\" target=\"_blank\">How to Create a Chatbot with ChatBot Open Source and Deploy It on the Web &#8211; Here we set project folder that we use in this post<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we will learn how to use sentiment analysis with API python from paralleldots.com. We will look at running this API from python environment on laptop and also in web application environment with python Django on pythonanywhere hosting site. In the one of previous post we set python Django project for chatbot. Here &#8230; <a title=\"Integrating Sentiment Analysis API Python Django into Web Application\" class=\"read-more\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[11,9,104,10,103],"tags":[108,107,106,105,109],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications\" \/>\n<meta property=\"og:description\" content=\"In this post we will learn how to use sentiment analysis with API python from paralleldots.com. We will look at running this API from python environment on laptop and also in web application environment with python Django on pythonanywhere hosting site. In the one of previous post we set python Django project for chatbot. Here ... Read more\" \/>\n<meta property=\"og:url\" content=\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\" \/>\n<meta property=\"og:site_name\" content=\"Machine Learning Applications\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-16T14:21:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-18T00:15:25+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-e1544973390491.png\" \/>\n<meta name=\"author\" content=\"owygs156\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"owygs156\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\",\"url\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\",\"name\":\"Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications\",\"isPartOf\":{\"@id\":\"https:\/\/intelligentonlinetools.com\/blog\/#website\"},\"datePublished\":\"2018-12-16T14:21:32+00:00\",\"dateModified\":\"2018-12-18T00:15:25+00:00\",\"author\":{\"@id\":\"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\"},\"breadcrumb\":{\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/intelligentonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrating Sentiment Analysis API Python Django into Web Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/intelligentonlinetools.com\/blog\/#website\",\"url\":\"https:\/\/intelligentonlinetools.com\/blog\/\",\"name\":\"Machine Learning Applications\",\"description\":\"Artificial intelligence, data mining and machine learning for building web based tools and services.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478\",\"name\":\"owygs156\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g\",\"caption\":\"owygs156\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/","og_locale":"en_US","og_type":"article","og_title":"Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications","og_description":"In this post we will learn how to use sentiment analysis with API python from paralleldots.com. We will look at running this API from python environment on laptop and also in web application environment with python Django on pythonanywhere hosting site. In the one of previous post we set python Django project for chatbot. Here ... Read more","og_url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/","og_site_name":"Machine Learning Applications","article_published_time":"2018-12-16T14:21:32+00:00","article_modified_time":"2018-12-18T00:15:25+00:00","og_image":[{"url":"http:\/\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2018\/12\/neural-network-3637503_640-e1544973390491.png"}],"author":"owygs156","twitter_card":"summary_large_image","twitter_misc":{"Written by":"owygs156","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/","url":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/","name":"Integrating Sentiment Analysis API Python Django into Web Application - Machine Learning Applications","isPartOf":{"@id":"https:\/\/intelligentonlinetools.com\/blog\/#website"},"datePublished":"2018-12-16T14:21:32+00:00","dateModified":"2018-12-18T00:15:25+00:00","author":{"@id":"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478"},"breadcrumb":{"@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/intelligentonlinetools.com\/blog\/2018\/12\/16\/integrating-sentiment-analysis-api-python-django-web-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/intelligentonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Integrating Sentiment Analysis API Python Django into Web Application"}]},{"@type":"WebSite","@id":"https:\/\/intelligentonlinetools.com\/blog\/#website","url":"https:\/\/intelligentonlinetools.com\/blog\/","name":"Machine Learning Applications","description":"Artificial intelligence, data mining and machine learning for building web based tools and services.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/intelligentonlinetools.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/7a886dc5eb9758369af2f6d2cb342478","name":"owygs156","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/intelligentonlinetools.com\/blog\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/b351def598609cb4c0b5bca26497c7e5?s=96&d=mm&r=g","caption":"owygs156"}}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7h1IJ-D9","jetpack-related-posts":[{"id":383,"url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/07\/03\/getting-the-data-from-the-web-using-php-for-api-using-the-api-with-php\/","url_meta":{"origin":2427,"position":0},"title":"Getting the Data from the Web using PHP or Python for API","date":"July 3, 2016","format":false,"excerpt":"In the previous posts [1],[2] perl was used to get content from the web through Faroo API and Guardian APIs. In this post PHP and Pyhton will be used to get web data using same APIs. PHP has a powerful JSON parsing mechanism, which, because PHP is a dynamic language,\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"Trend for Python, Perl, PHP","src":"https:\/\/i0.wp.com\/intelligentonlinetools.com\/blog\/wp-content\/uploads\/2016\/07\/trend_for_python_perl_php-300x144.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":827,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/01\/11\/apis\/","url_meta":{"origin":2427,"position":1},"title":"Useful APIs for Your Web Site","date":"January 11, 2017","format":false,"excerpt":"Here\u2019s a useful list of resources on how to create an API, compiled from posts that were published recently on this blog. The included APIs can provide a fantastic ways to enhance websites. 1. The WordPress(WP) API exposes a simple yet powerful interface to WP Query, the posts API, post\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1410,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/10\/26\/image-processing-using-pixabay-api-and-python\/","url_meta":{"origin":2427,"position":2},"title":"Image Processing Using Pixabay API and Python","date":"October 26, 2017","format":false,"excerpt":"Recently I visited great website Pixabay [1] that offers a wide range of images from people all around the world. These images are free to use even for commercial use. And there is an API [2] for accessing images on Pixabay. This brings a lot of ideas for interesting web\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1446,"url":"http:\/\/intelligentonlinetools.com\/blog\/2017\/11\/06\/10-new-top-resources-on-machine-learning-from-around-the-web\/","url_meta":{"origin":2427,"position":3},"title":"10 New Top Resources on Machine Learning from Around the Web","date":"November 6, 2017","format":false,"excerpt":"For this post I put new and most interesting machine learning resources that I recently found on the web. This is the list of useful resources in such areas like stock market forecasting, text mining, deep learning, neural networks and getting data from Twitter. Hope you enjoy the reading. 1.\u2026","rel":"","context":"In &quot;Machine Learning&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":766,"url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/12\/31\/retrieving-post-data-using-the-wordpress-api-with-python-script\/","url_meta":{"origin":2427,"position":4},"title":"Retrieving Post Data Using the WordPress API with Python Script","date":"December 31, 2016","format":false,"excerpt":"In this post we will create python script that is able to get data from WordPress (WP) blog using WP API. This script will save downloaded data into csv file for further analysis or other purposes. WP API is returning data in json format and is accessible through link http:\/\/hostname.com\/wp-json\/wp\/v2\/posts.\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":510,"url":"http:\/\/intelligentonlinetools.com\/blog\/2016\/08\/19\/getting-data-from-wikipedia-using-python\/","url_meta":{"origin":2427,"position":5},"title":"Getting Data From Wikipedia Using Python","date":"August 19, 2016","format":false,"excerpt":"Recently I come across python package Wikipedia which is a Python library that makes it easy to access and parse data from Wikipedia. Using this library you can search Wikipedia, get article summaries, get data like links and images from a page, and more. Wikipedia wraps the MediaWiki API so\u2026","rel":"","context":"In &quot;API Programming&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2427"}],"collection":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=2427"}],"version-history":[{"count":22,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2427\/revisions"}],"predecessor-version":[{"id":2429,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/2427\/revisions\/2429"}],"wp:attachment":[{"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=2427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=2427"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/intelligentonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=2427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}