{"id":293,"date":"2017-11-10T11:12:39","date_gmt":"2017-11-10T11:12:39","guid":{"rendered":"https:\/\/eodhd.com\/knowledgebase\/?p=293"},"modified":"2024-04-24T12:46:40","modified_gmt":"2024-04-24T10:46:40","slug":"java-stock-api-example","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example","title":{"rendered":"Java Stock API Example"},"content":{"rendered":"<p>Here you can find a Java example on how to use our API.<\/p>\n<p>In this API we provide source code for both <a href=\"https:\/\/eodhistoricaldata.com\/financial-apis\/api-for-historical-data-and-volumes\/\">EOD API<\/a> and <a href=\"https:\/\/eodhistoricaldata.com\/financial-apis\/stock-etfs-fundamental-data-feeds\/\">Fundamentals API<\/a>. The example works with JSON version of our API, which provide more data and more flexible than CSV output.<\/p>\n<p>Here you can download source code for via github: <a href=\"https:\/\/github.com\/EodHistoricalData\/Java-API-Example\">https:\/\/github.com\/EodHistoricalData\/Java-API-Example<\/a>.<\/p>\n<p>An example of Java-code for End-of-Day API:<\/p>\n<blockquote>\n<pre>import com.google.gson.annotations.Expose;\nimport com.google.gson.annotations.SerializedName;\n\npublic class EodStock {\n\n    @SerializedName(\"General\")\n    @Expose\n    private General general;\n    @SerializedName(\"Highlights\")\n    @Expose\n    private Highlights highlights;\n    @SerializedName(\"Earnings\")\n    @Expose\n    private Earnings earnings;\n    @SerializedName(\"Financials\")\n    @Expose\n    private Financials financials;\n\n    public General getGeneral() {\n        return general;\n    }\n\n    public void setGeneral(General general) {\n        this.general = general;\n    }\n\n    public Highlights getHighlights() {\n        return highlights;\n    }\n\n    public void setHighlights(Highlights highlights) {\n        this.highlights = highlights;\n    }\n\n    public Earnings getEarnings() {\n        return earnings;\n    }\n\n    public void setEarnings(Earnings earnings) {\n        this.earnings = earnings;\n    }\n\n    public Financials getFinancials() {\n        return financials;\n    }\n\n    public void setFinancials(Financials financials) {\n        this.financials = financials;\n    }\n\n}<\/pre>\n<\/blockquote>\n<p>Here you can download source code for via github: <a href=\"https:\/\/github.com\/EodHistoricalData\/Java-API-Example\">https:\/\/github.com\/EodHistoricalData\/Java-API-Example<\/a>.<\/p>\n<p>If you have any questions and\/or suggestions, please tell us via email: support@eodhistoricaldata.com.<\/p>\n<p>&nbsp;<\/p>\n\n\n<p class=\"has-text-align-center\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Sign up &amp; Get Data<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here you can find a Java example on how to use our API. In this API we provide source code for both EOD API and Fundamentals API. The example works with JSON version of our API, which provide more data and more flexible than CSV output. Here you can download source code for via github: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4483,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[],"coding-language":[],"ready-to-go-solution":[],"qualification":[],"financial-apis-category":[],"financial-apis-manuals":[],"class_list":["post-293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-python-php-laravel-java-matlab-examples","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.6 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Stock API Example | EODHD APIs Documentation<\/title>\n<meta name=\"description\" content=\"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Stock API Example\" \/>\n<meta property=\"og:description\" content=\"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\" \/>\n<meta property=\"og:site_name\" content=\"Stock Price Data, Financial and Stock Market API\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-10T11:12:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-24T10:46:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png\" \/>\n\t<meta property=\"og:image:width\" content=\"270\" \/>\n\t<meta property=\"og:image:height\" content=\"270\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"EOD Historical Data Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"EOD Historical Data Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\"},\"author\":{\"name\":\"EOD Historical Data Support\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415\"},\"headline\":\"Java Stock API Example\",\"datePublished\":\"2017-11-10T11:12:39+00:00\",\"dateModified\":\"2024-04-24T10:46:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\"},\"wordCount\":104,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png\",\"articleSection\":[\"5. Developer Tools &amp; Examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\",\"name\":\"Java Stock API Example | EODHD APIs Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png\",\"datePublished\":\"2017-11-10T11:12:39+00:00\",\"dateModified\":\"2024-04-24T10:46:40+00:00\",\"description\":\"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png\",\"width\":270,\"height\":270,\"caption\":\"Java Stock API Example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-apis\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Stock API Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"name\":\"Historical Stock Prices and Fundamental Financial Data APIs | EODHD\",\"description\":\"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415\",\"name\":\"EOD Historical Data Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g\",\"caption\":\"EOD Historical Data Support\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java Stock API Example | EODHD APIs Documentation","description":"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API","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:\/\/eodhd.com\/financial-apis\/java-stock-api-example","og_locale":"en_US","og_type":"article","og_title":"Java Stock API Example","og_description":"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API","og_url":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example","og_site_name":"Stock Price Data, Financial and Stock Market API","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2017-11-10T11:12:39+00:00","article_modified_time":"2024-04-24T10:46:40+00:00","og_image":[{"width":270,"height":270,"url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","type":"image\/png"}],"author":"EOD Historical Data Support","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"EOD Historical Data Support","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example"},"author":{"name":"EOD Historical Data Support","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415"},"headline":"Java Stock API Example","datePublished":"2017-11-10T11:12:39+00:00","dateModified":"2024-04-24T10:46:40+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example"},"wordCount":104,"publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","articleSection":["5. Developer Tools &amp; Examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example","url":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example","name":"Java Stock API Example | EODHD APIs Documentation","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/#website"},"primaryImageOfPage":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","datePublished":"2017-11-10T11:12:39+00:00","dateModified":"2024-04-24T10:46:40+00:00","description":"Learn how to use our Java Stock API with this comprehensive example. Get the source code for both EOD and Fundamentals API","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-apis\/java-stock-api-example"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#primaryimage","url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","contentUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","width":270,"height":270,"caption":"Java Stock API Example"},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-apis\/java-stock-api-example#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-apis"},{"@type":"ListItem","position":2,"name":"Java Stock API Example"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-apis\/#website","url":"https:\/\/eodhd.com\/financial-apis\/","name":"Historical Stock Prices and Fundamental Financial Data APIs | EODHD","description":"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API","publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-apis\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-apis\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/fa5be3606e0cd967a175978cebe97415","name":"EOD Historical Data Support","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3599a531133e7fc83654b72e3103c05b1bbeb91168cf4786cbad64afa9b82413?s=96&d=mm&r=g","caption":"EOD Historical Data Support"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2017\/11\/Java-Stock-API-Example.png","jetpack_shortlink":"https:\/\/wp.me\/p8NjB1-4J","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/comments?post=293"}],"version-history":[{"count":2,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/293\/revisions"}],"predecessor-version":[{"id":5736,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/293\/revisions\/5736"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/media\/4483"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/media?parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/categories?post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/tags?post=293"},{"taxonomy":"coding-language","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/coding-language?post=293"},{"taxonomy":"ready-to-go-solution","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/ready-to-go-solution?post=293"},{"taxonomy":"qualification","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/qualification?post=293"},{"taxonomy":"financial-apis-category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/financial-apis-category?post=293"},{"taxonomy":"financial-apis-manuals","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/financial-apis-manuals?post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}