Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra-sites domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/statplace/public_html/site/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the jetpack domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/statplace/public_html/site/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpforms-lite domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/statplace/public_html/site/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/statplace/public_html/site/wp-includes/functions.php on line 6114

Notice: A função _load_textdomain_just_in_time foi chamada incorretamente. O carregamento da tradução para o domínio astra foi ativado muito cedo. Isso geralmente é um indicador de que algum código no plugin ou tema está sendo executado muito cedo. As traduções devem ser carregadas na ação init ou mais tarde. Leia como Depurar o WordPress para mais informações. (Esta mensagem foi adicionada na versão 6.7.0.) in /home/statplace/public_html/site/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/statplace/public_html/site/wp-includes/functions.php:6114) in /home/statplace/public_html/site/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":6796,"date":"2020-07-30T13:00:48","date_gmt":"2020-07-30T16:00:48","guid":{"rendered":"https:\/\/site.statplace.com.br\/?p=6796"},"modified":"2024-10-07T15:58:18","modified_gmt":"2024-10-07T15:58:18","slug":"trabalhando-com-api-no-r","status":"publish","type":"post","link":"https:\/\/site.statplace.com.br\/blog\/trabalhando-com-api-no-r\/","title":{"rendered":"Trabalhando com API no R"},"content":{"rendered":"\n

Artigo escrito com a colabora\u00e7\u00e3o de Val\u00e9ria Nic\u00e9ria da Silva.<\/p>\n\n\n\n

Os dados s\u00e3o uns dos elementos mais importantes de um projeto de ci\u00eancia de dados. Existem v\u00e1rias formas de se obter os dados, mas as APIs v\u00eam se tornando uma das formas mais comuns. A sigla vem do termo em ingl\u00eas\u00a0\u201cApplication Programming Interface\u201d<\/em>\u00a0ou \u201cInterface de Programa\u00e7\u00e3o para Aplicativos\u201d<\/em><\/p>\n\n\n\n

Uma das grandes vantagens de utilizar APIs \u00e9 que ela n\u00e3o depende de uma linguagem de programa\u00e7\u00e3o, faremos uma requisi\u00e7\u00e3o a uma URL<\/em>, que nos retornar\u00e1 uma resposta. Apesar disso, todos os exemplos que mostrarei aqui, utilizam a linguagem R<\/a>. <\/p>\n\n\n\n

Antes de exemplificar como podemos acessar e criar uma API no R, vamos entender algumas coisas relacionadas a API de forma geral.<\/p>\n\n\n\n

\"\"<\/figure><\/div>\n\n\n\n

Endpoint<\/h2>\n\n\n\n

O endpoint \u00e9 uma URL<\/em>, um caminho, onde iremos fazer uma requisi\u00e7\u00e3o e que possui a seguinte estrutura.<\/p>\n\n\n\n