{"id":18479,"date":"2020-06-25T10:17:47","date_gmt":"2020-06-25T17:17:47","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=18479"},"modified":"2023-12-01T03:27:02","modified_gmt":"2023-12-01T11:27:02","slug":"python-requests","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-requests\/","title":{"rendered":"Python Requests: A Guide"},"content":{"rendered":"\n<p>When you\u2019re building an application in Python, there may come a time when you want to connect to a third-party service. For instance, if you\u2019re building a fitness tool you may want to connect to the Fitbit API so you can see your exercise data; an app that can send text messages may connect to the Twilio API.<br><\/p>\n\n\n\n<p>In Python, the requests library allows you to make requests so you can connect third-party web services to your applications. In this guide, we\u2019re going to learn about the Python requests library and how you can use it to send HTTP requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web Requests: A Refresher<\/h2>\n\n\n\n<p>Requests are at the center of the Internet. When you clicked on this article, a HTTP request was sent to the Career Karma server. That request told our servers what web page you wanted to see so our server could find the page. Once the web page was found, our web server returned it to your browser. This process allows you to see this tutorial.<br><\/p>\n\n\n\n<p>Web requests come in many different forms. The type of request you made to view this web page was called a GET request. This type of request allows you to retrieve data. There are other types of requests such as POST and PUT, which are used to modify the resources on a server. For the purposes of this tutorial, we\u2019re going to focus on GET and POST requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Install Requests<\/h2>\n\n\n\n<p>Requests is the HTTP library for Python that allows you to make web requests.<br><\/p>\n\n\n\n<p>Before we can make web requests using Python, we have to install the Python requests code library. We can do so using the following command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>pip install requests<\/pre><\/div>\n\n\n\n<p>Now that we\u2019ve downloaded the Python package, we\u2019re ready to make a web request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Make a GET Request<\/h2>\n\n\n\n<p>The most common type of web request you\u2019ll make is a GET request. This type of request allows you to retrieve data from a server.<br><\/p>\n\n\n\n<p>Let\u2019s say we are making an app that allows you to retrieve a list of cat facts. To do so, we\u2019re going to use an API called cat-facts. This API is open to the public, so we don\u2019t need any credentials to sign in. We could use this code to make a request to the API:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import requests\nres = requests.get('https:\/\/cat-fact.herokuapp.com\/facts')\nprint(res.status_code)<\/pre><\/div>\n\n\n\n<p>This code returned: 200. Let\u2019s break down our code.<br><\/p>\n\n\n\n<p>On the first line, we imported the requests library. This allowed us to access the requests library that we will use in our tutorial. Then we used the <code>requests.get()<\/code> method to make a web request. We could have used methods like <code>.put()<\/code> or <code>.post()<\/code> to make other types of requests, but in this case we only needed to retrieve data from the cat-facts API.<br><\/p>\n\n\n\n<p>Next, we printed out the status code from our web request. The number 200 was returned, which told us our web request was made successfully. We\u2019ll discuss what these numbers mean later in the tutorial.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Viewing a Request<\/h2>\n\n\n\n<p>In our example above, we have printed out the status code of our request. But how can we see the data we have retrieved? Where are the cat facts? That\u2019s where the .text and <code>.json()<\/code> methods come in.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">View Text Response<\/h3>\n\n\n\n<p>We can use the .text method to see the result of our web request:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import requests\nres = requests.get('https:\/\/cat-fact.herokuapp.com\/facts')\nprint(res.text)<\/pre><\/div>\n\n\n\n<p>This code returned a list of cat facts. But, this isn\u2019t very practical for us because the data we are querying is an API. While we now have a Python list of cat facts, it is difficult for us to read them because they are in plain text.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">View JSON Response<\/h3>\n\n\n\n<p>A more useful format in which our cat facts could be stored is JSON. We could retrieve the JSON data from our request using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(res.json())<\/pre><\/div>\n\n\n\n<p>Our code returns a long list of cat facts. Here\u2019s the first record in the list:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{'_id': '58e009550aac31001185ed12', 'text': 'The oldest cat video on YouTube dates back to 1894.', 'type': 'cat', 'user': {'_id': '58e007480aac31001185ecef', 'name': {'first': 'Kasimir', 'last': 'Schulz'}}, 'upvotes': 6, 'userUpvoted': None}<\/pre><\/div>\n\n\n\n<p>Success! We\u2019ve managed to retrieve our list of cat facts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Make a POST Request<\/h2>\n\n\n\n<p>You can also use the requests library to make a POST request. This will allow you to modify the data stored on a web server.<br><\/p>\n\n\n\n<p>For this example, we\u2019re going to use the Airtable API. This is because we need to use an API that supports POST requests and the cat-facts API is read only.<br><\/p>\n\n\n\n<p>Suppose we have a database where we record all the cups of tea we drink. We\u2019ve just drank another cup of tea and we want to add it to the database. We could do so using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import requests\nheaders = {\n'Authorization': 'Bearer API_KEY',\n'Content-Type': 'application\/json',\n}\ndata = '{\"records\": [{\"fields\": {\"Drink\": \"Black Decaf Tea\"}}]}'\nres = requests.post('https:\/\/cat-fact.herokuapp.com\/facts', headers=headers, data=data)\nprint(res.json())<\/pre><\/div>\n\n\n\n<p>Our code returned:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{'records': [{'id': 'recqUEPuXEAXaNl1L', 'fields': {'Drink': 'Black Decaf Tea', 'Date': '2020-06-16T08:53:02.000Z'}, 'createdTime': '2020-06-16T08:53:02.000Z'}]}<\/pre><\/div>\n\n\n\n<p>This tells us our HTTP request was successful. We\u2019ve just added a record to our Airtable database using their API. Let\u2019s discuss these lines of code further.<br><\/p>\n\n\n\n<p>First, we imported the requests library so we could make HTTP requests in our code.<br><\/p>\n\n\n\n<p>We then defined a dictionary which contained two keys and values: one which stored our authentication key and another which specified the type of content we were sending to the web server. These are the headers that we needed to send to make a request to the Airtable API.<br><\/p>\n\n\n\n<p>Next, we declared a variable called data which stored the data we wanted to send alongside our POST request. In this case, we were adding a drink called \u201cBlack Decaf Tea\u201d to our database. We then used the <code>requests.post()<\/code> method and specified our headers and data as parameters, which allowed us to make a POST request to the Airtable API.<br><\/p>\n\n\n\n<p>Finally, we printed out the result of our request in the JSON format using <code>res.json()<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HTTP Status Codes<\/h2>\n\n\n\n<p>The HTTP protocol returns a unique status code when you make a web request. This allows you to see whether your web request has been successful or whether any errors have occurred. You\u2019ve probably seen a few of these already, such as 404.<br><\/p>\n\n\n\n<p>Here is a reference list of status codes you may encounter when making a request with Python requests:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1XX: Information<\/li>\n\n\n\n<li>2XX: Request was made successfully<\/li>\n\n\n\n<li>3XX: Request was redirected<\/li>\n\n\n\n<li>4XX: Client-side error<\/li>\n\n\n\n<li>5XX: Server-side error<\/li>\n<\/ul>\n\n\n\n<p>Knowing these status codes allows us to add debugging into our program. Let\u2019s take the GET request from the cat-facts API example from earlier. Suppose we want to print out a message if the resource we are accessing cannot be found. We could do so using this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import requests\nres = requests.get('https:\/\/cat-fact.herokuapp.com\/facts')\nif res.status_code == 200:\n\tprint(\"Success\")\nelse :\n\tprint(\"Error\")<\/pre><\/div>\n\n\n\n<p>Our code returned: Success. Because the status code of our request is 200, the message \u201cSuccess\u201d is printed to the console. However, if our request had failed \u2013 for instance, we may have specified an invalid URL \u2013 then the message \u201cError\u201d would have been printed to the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Python requests library allows you to make HTTP requests in Python. In this guide, we discussed how the Python requests library is used to make GET and POST requests, but you can also make PUT and DELETE requests using the library.<br><\/p>\n\n\n\n<p>When you use a method like <code>requests.get()<\/code> or <code>requests.post()<\/code>, Python will make a request to the web resource which you want to access. You can attach headers and data with your request, which allows you to send information if you want to make changes to a web resource you own.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to start using the Python requests library like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"When you\u2019re building an application in Python, there may come a time when you want to connect to a third-party service. For instance, if you\u2019re building a fitness tool you may want to connect to the Fitbit API so you can see your exercise data; an app that can send text messages may connect to&hellip;","protected":false},"author":240,"featured_media":18480,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-18479","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Requests: A Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-requests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Requests: A Guide\" \/>\n<meta property=\"og:description\" content=\"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-requests\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-25T17:17:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:27:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"678\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python Requests: A Guide\",\"datePublished\":\"2020-06-25T17:17:47+00:00\",\"dateModified\":\"2023-12-01T11:27:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/\"},\"wordCount\":1215,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-requests\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-requests\/\",\"name\":\"Python Requests: A Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg\",\"datePublished\":\"2020-06-25T17:17:47+00:00\",\"dateModified\":\"2023-12-01T11:27:02+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-requests\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg\",\"width\":1020,\"height\":678},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-requests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Requests: A Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Requests: A Guide | Career Karma","description":"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.","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":"https:\/\/careerkarma.com\/blog\/python-requests\/","og_locale":"en_US","og_type":"article","og_title":"Python Requests: A Guide","og_description":"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.","og_url":"https:\/\/careerkarma.com\/blog\/python-requests\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-25T17:17:47+00:00","article_modified_time":"2023-12-01T11:27:02+00:00","og_image":[{"width":1020,"height":678,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python Requests: A Guide","datePublished":"2020-06-25T17:17:47+00:00","dateModified":"2023-12-01T11:27:02+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/"},"wordCount":1215,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-requests\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-requests\/","url":"https:\/\/careerkarma.com\/blog\/python-requests\/","name":"Python Requests: A Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg","datePublished":"2020-06-25T17:17:47+00:00","dateModified":"2023-12-01T11:27:02+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Python requests is a library that allows you to make HTTP requests in Python. On Career Karma, learn how to use the requests library to make GET and POST requests in your code.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-requests\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/thomas-jensen-ISG-rUel0Uw-unsplash.jpg","width":1020,"height":678},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-requests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python Requests: A Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=18479"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18479\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18480"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=18479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=18479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=18479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}