Clients.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using Microsoft.Net.Http.Headers;
  2. namespace economy.Models
  3. {
  4. // 공공데이터 API
  5. public class DataGoKR
  6. {
  7. public readonly HttpClient httpClient;
  8. public readonly string APIUrl = "http://apis.data.go.kr";
  9. public readonly string APIKey = "ee10c32875a7f8594ab0642a19e65eae38b2bc949b97089327b9466b6a5bc996";
  10. public DataGoKR(HttpClient e)
  11. {
  12. httpClient = e;
  13. httpClient.BaseAddress = new Uri(APIUrl);
  14. }
  15. }
  16. // 화훼공판장 API
  17. public class FlowerAtOrKR
  18. {
  19. public readonly HttpClient httpClient;
  20. public readonly string APIUrl = "https://flower.at.or.kr";
  21. public readonly string APIKey = "5F70416B443241BE846D0807744FC489";
  22. public FlowerAtOrKR(HttpClient e)
  23. {
  24. httpClient = e;
  25. httpClient.BaseAddress = new Uri(APIUrl);
  26. }
  27. }
  28. // 한국수출입은행 API
  29. public class KoreaEximGoKR
  30. {
  31. public readonly HttpClient httpClient;
  32. public readonly string APIUrl = "https://www.koreaexim.go.kr";
  33. public readonly string ExchangeAPIKey = "OiZlh6SjbXGBlfbagekBpi6kAE4UyonP"; // 환율
  34. public readonly string InterestAPIKey = "4olJNSqYHe4oVsW50JFXpXyYmDh9O9NN"; // 대출금리
  35. public readonly string InternationalAPIKey = "UI3DgPS3oZucxxCThkJQV6eAGprSbLJy"; // 국제금리
  36. public KoreaEximGoKR(HttpClient e)
  37. {
  38. httpClient = e;
  39. httpClient.BaseAddress = new Uri(APIUrl);
  40. }
  41. }
  42. // 동행복권
  43. public class DhlotteryCoKR
  44. {
  45. public readonly HttpClient httpClient;
  46. public readonly string APIUrl = "https://www.dhlottery.co.kr";
  47. public DhlotteryCoKR(HttpClient e)
  48. {
  49. httpClient = e;
  50. httpClient.BaseAddress = new Uri(APIUrl);
  51. }
  52. }
  53. // FIFA 순위
  54. public class FIFA_API
  55. {
  56. public readonly HttpClient httpClient;
  57. public readonly string APIUrl = "https://api.fifa.com";
  58. public FIFA_API(HttpClient e)
  59. {
  60. httpClient = e;
  61. httpClient.BaseAddress = new Uri(APIUrl);
  62. }
  63. }
  64. // 국세청 API
  65. public class NTS_API
  66. {
  67. public readonly HttpClient httpClient;
  68. public readonly string APIUrl = "http://api.odcloud.kr";
  69. public readonly string APIKey = "vQz8tIxrdhjerG6DE1w1hcVEli5S27LtIsCvx0axiieZmRgOpB4vToQ77VmvknAkIC9YjxlPx2gDZcl06S88Xw%3D%3D";
  70. public NTS_API(HttpClient e)
  71. {
  72. httpClient = e;
  73. httpClient.BaseAddress = new Uri(APIUrl);
  74. }
  75. }
  76. // Alphavantage API
  77. public class Alpha_API
  78. {
  79. public readonly HttpClient httpClient;
  80. public readonly string APIUrl = "https://www.alphavantage.co";
  81. public readonly string APIKey = "EFOBUHL5SFLBF2LN";
  82. public Alpha_API(HttpClient e)
  83. {
  84. httpClient = e;
  85. httpClient.BaseAddress = new Uri(APIUrl);
  86. }
  87. }
  88. }