User Tools

Site Tools


using_open_api_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
using_open_api_example [2020/06/04 01:46] – created hkimscilusing_open_api_example [2024/05/23 10:25] (current) hkimscil
Line 32: Line 32:
     * [[https://developer.amazon.com/public/apis|Amazon APIs]]     * [[https://developer.amazon.com/public/apis|Amazon APIs]]
     * [[https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html|Product Advertising API]]     * [[https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html|Product Advertising API]]
 +
 +
 +http://data.go.kr
 +http://data.seoul.go.kr
 +
 +<code>
 +install.packages("XML")
 +library(XML)
 +
 +# https://data.seoul.go.kr/
 +
 +mykey <- "6c7a765a55627a6a33366e48767266"
 +
 +
 +url = "http://openapi.seoul.go.kr:8088"
 +auth_key = mykey
 +type = 'xml'
 +service = 'culturalEventInfo'
 +startindex = '1'
 +endindex = '50'
 +api_url = paste(url, auth_key, type, service, startindex, endindex, sep = '/')
 +
 +api_url
 +
 +parsedXml <-xmlParse(api_url)
 +
 +rowXml <- getNodeSet(parsedXml, "//row")
 +
 +api_data <-xmlToDataFrame(rowXml, stringsAsFactors = F)
 +
 +#구조 확인
 +str(api_data)
 +
 +#테이블 확인
 +View(api_data)
 +api_data
 +
 +write.table(api_data,
 +            file = "SeoulCulturalEventInfo.csv",
 +            append = FALSE, quote = TRUE, sep = ",",
 +            eol = "\n", na = "NA", col.names = T, 
 +            row.names = F)
 +
 +</code>
 +
  
 ---- ----
-{{all_comb.xlsx}}+{{:all_comb.xlsx}}
 <code>library(bitops) <code>library(bitops)
 library(RCurl) library(RCurl)
Line 88: Line 133:
 </code> </code>
  
-{{ani_plot.png}}+{{:ani_plot.png}}
  
-{{myTdm-ani.txt}}+{{:myTdm-ani.txt}}
  
 <code><!DOCTYPE html> <code><!DOCTYPE html>
using_open_api_example.1591202789.txt.gz · Last modified: 2020/06/04 01:46 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki