{"id":28250472,"url":"https://github.com/zackurben/cex.io-api-java","last_synced_at":"2026-02-28T04:05:25.216Z","repository":{"id":12841435,"uuid":"15517025","full_name":"zackurben/cex.io-api-java","owner":"zackurben","description":"Cex.io Java API","archived":false,"fork":false,"pushed_at":"2014-11-17T02:45:11.000Z","size":310,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T01:38:57.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zackurben.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-29T23:56:52.000Z","updated_at":"2021-01-11T09:07:25.000Z","dependencies_parsed_at":"2022-09-15T19:01:11.225Z","dependency_job_id":null,"html_url":"https://github.com/zackurben/cex.io-api-java","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zackurben/cex.io-api-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fcex.io-api-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fcex.io-api-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fcex.io-api-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fcex.io-api-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackurben","download_url":"https://codeload.github.com/zackurben/cex.io-api-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fcex.io-api-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T14:18:21.388Z","updated_at":"2026-02-28T04:05:25.210Z","avatar_url":"https://github.com/zackurben.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Cex.io Java API\nThe Java source files and examples for the Cex.io API. This is an Open Source project under the MIT license.\n\n## Index\n - [Contact](#contact)\n - [Support](#support)\n - [How to Use](#how-to-use)\n - [Methods and Parameters](#parameters-and-methods)\n  - [Methods](#methods)\n  - [Parameters](#parameters)\n - [Examples with Output](#examples-with-output)\n  - [Create API Object](#create-api-object)\n  - [Fetch Ticker Data](#fetch-ticker-data)\n  - [Fetch Last Price](#fetch-last-price)\n  - [Convert Currency](#convert-currency)\n  - [Fetch Historical Data](#fetch-historical-data)\n  - [Fetch Order Book](#fetch-order-book)\n  - [Fetch Trade History](#fetch-trade-history)\n  - [Fetch Account Balance](#fetch-account-balance)\n  - [Place an Order](#place-an-order)\n  - [Fetch Open Orders](#fetch-open-orders)\n  - [Cancel Open Order](#cancel-open-order)\n  - [Fetch Account Hash Rate](#fetch-account-hash-rate)\n  - [Fetch Worker Hash Rate](#fetch-worker-hash-rate)\n - [Additional Help](#additional-help)\n\n## Contact\n```\nAuthor : Zack Urben\nContact: zackurben@gmail.com\n```\n\n## Support\nIf you would like to support the development of this project, please spread the word and donate!\n\n```\nMotivation BTC   : 1HvXfXRP9gZqHPkQUCPKmt5wKyXDMADhvQ\nCryptsy Trade Key: e5447842f0b6605ad45ced133b4cdd5135a4838c\n```\n\n**Additional Windows help on the [Project Wiki](https://github.com/zackurben/cex.io-api-java/wiki/Windows-Setup:-Basic-Help).**\n\n##How to use\n1. Download this API source.\n2. Generate a Cex.io API key and API secret (https://cex.io/trade/profile).\n - This key needs all the permissions, to enable full functionality.\n3. Create your Java project\n4. Add the API to your project directory.\n5. Create an API object:\n\n```java\n// API Object Parameters:\n\"username\"   // Your Cex.io username\n\"api_key\"    // Your Cex.io API key\n\"api_secret\" // Your Cex.io API secret\n\nCexAPI test = new CexAPI(\"username\", \"api_key\", \"api_secret\");\n```\n\n##Parameters and Methods\n###Parameters\n\n```java \n           // Description      (Data Type) : Value range.\n\"pair\"     // Currency Pair    (String)    : \"GHS/BTC\", \"LTC/BTC\", \"NMC/BTC\", \"GHS/NMC\", \"BF1/BTC\"\n\"major\"    // Major Currency   (String)    : TODO\n\"minor\"    // Minor Currency   (String)    : TODO\n\"hours\"    // Hours            (Integer)   : TODO\n\"count\"    // Result Count     (Integer)   : TODO\n\"since\"    // Timestamp        (Integer)   : 1 - 2147483647\n\"order_id\" // Order Number     (String)    : TODO\n\"type\"     // Order Type       (String)    : \"buy\", \"sell\"\n\"amount\"   // Order Quantity   (Float)     : 0.00000001 - 9223372036854775807\n\"price\"    // Order Price      (Float)     : 0.00000001 - 9223372036854775807\n```\n\n###Methods\n\n```java \n// Method Format, with required parameters:\n   \n// Fetch the ticker data, for the currency pair.\nticker(\"pair\");\n\n// Fetch the last order price for the currency pair.\nlastPrice(\"major\", \"minor\");\n\n// Fetch the price conversion from the Major to Minor currency.\nconvert(\"major\", \"minor\", \"amount\");\n\n// Fetch the historical data points for the Major to Minor currency.\nchart(\"major\", \"minor\", \"hours\", \"count\")\n\n// Fetch the order book data, for the currency pair.\norderBook(\"pair\");\n\n// Fetch the trade history data, for the currency pair.\ntradeHistory(\"pair\", \"order_id\");\n\n// Fetch the account balance data.\nbalance();\n\n// Place an order, for the currency pair, with the given amount and price.\nplaceOrder(\"pair\", \"type\", \"amount\", \"price\");\n\n// Fetch the account open orders, for the currency pair.\nopenOrders(\"pair\");\n\n// Cancel the account order with the given ID.\ncancelOrder(\"order_id\");\n\n// Fetch the GHash.io hash rates for the last 24 hours.\nhashrate();\n\n// Fetch the GHash.io worker stats for the last 24 hours.\nworkers();\n```\n \n##Examples with Output\n###Create API object:\n\n```java \n// API Object Parameters:\n\"username\"   // Your Cex.io username\n\"api_key\"    // Your Cex.io API key\n\"api_secret\" // Your Cex.io API secret\n\nCexAPI test = new CexAPI(\"username\", \"api_key\", \"api_secret\");\n```\n\n```json\n{\n    \"username\": \"xxx\",\n    \"apiKey\": \"xxx\",\n    \"apiSecret\": \"xxx\",\n    \"nonce\": \"xxx\"\n}\n```\n\n###Fetch Ticker Data\nFetch the ticker data, for the currency pair \"GHS/BTC\".\n\n```java\nticker(\"GHS/BTC\");\n```\n\n```json\n{\n    \"timestamp\": \"1414961682\",\n    \"bid\": 0.00267964,\n    \"ask\": 0.00268965,\n    \"low\": \"0.00261101\",\n    \"high\": \"0.0027\",\n    \"last\": \"0.00268966\",\n    \"volume\": \"43614.47202243\"\n}\n```\n\n###Fetch Last Price\nFetch the last order price for the currency pair.\n\n```java\nlastPrice(\"BTC\", \"USD\");\n```\n\n```json\n{\n    \"lprice\": \"334.2772\"\n}\n```\n\n###Convert Currency\nFetch the price conversion from the Major to Minor currency.\n\n```java\nconvert(\"BTC\", \"USD\", 2f);\n```\n\n```json\n{\n    \"amnt\": 669.9326\n}\n```\n\n###Fetch Historical Data\nFetch the historical data points for the Major to Minor currency.\n\n```java\nchart(\"BTC\", \"USD\", 24, 2);\n```\n\n```json\n[\n    {\n        \"tmsp\": 1415424600,\n        \"price\": \"334.1699\"\n    },\n    {\n        \"tmsp\": 1415467800,\n        \"price\": \"335.2923\"\n    }\n]\n```\n\n###Fetch Order Book\nFetch the order book data, for the currency pair \"GHS/BTC\" (Most results removed for length).\n\n```java\norderBook(\"GHS/BTC\");\n```\n\n```json\n{\n    \"timestamp\": \"1388458859\",\n    \"bids\": [\n        [\n            0.03524828,\n            \"0.09861694\"\n        ]\n    ],\n    \"asks\": [\n        [\n            0.03524829,\n            \"6.33317172\"\n        ]\n    ]\n}\n```\n\n###Fetch Trade History\nFetch the trade history data, for the currency pair \"GHS/BTC\" (Most results removed for length).\n\n```java\ntradeHistory(\"GHS/BTC\", 1);\n```\n\n```json\n[\n    {\n        \"amount\": \"0.00030000\",\n        \"price\": \"0.0079206\",\n        \"date\": \"1398634455\",\n        \"tid\": 4096963\n    }\n]\n```\n\n###Fetch Account Balance\nFetch the account balance data.\n\n```java\nbalance();\n```\n\n```json\n{\n    \"timestamp\": \"1398634457\",\n    \"username\": \"xxx\",\n    \"BTC\": {\n        \"available\": \"xxx\",\n        \"orders\": \"xxx\"\n    },\n    \"GHS\": {\n        \"available\": \"xxx\",\n        \"orders\": \"xxx\"\n    },\n    \"IXC\": {\n        \"available\": \"xxx\",\n        \"orders\": \"xxx\"\n    },\n    \"DVC\": {\n        \"available\": \"xxx\"\n    },\n    \"NMC\": {\n        \"available\": \"xxx\",\n        \"orders\": \"xxx\"\n    },\n    \"LTC\": {\n        \"available\": \"xxx\",\n        \"orders\": \"xxx\"\n    }\n}\n```\n\n###Place an Order\nPlace an order, for the currency pair, with the given amount and price.\n\n```java\nplaceOrder(\"GHS/BTC\", \"buy\", 1f, 0.00000001f);\n```\n\n```json\n{\n    \"id\": \"829229545\",\n    \"time\": 1398634457348,\n    \"pending\": \"1.00000000\",\n    \"amount\": \"1.00000000\",\n    \"type\": \"buy\",\n    \"price\": \"0.00000001\"\n}\n```\n\n###Fetch Open Orders\nFetch the account open orders, for the currency pair.\n\n```java\nopenOrders(\"GHS/BTC\");\n```\n\n```json\n[\n    {\n        \"id\": \"829229545\",\n        \"time\": \"1398634457348\",\n        \"type\": \"buy\",\n        \"price\": \"0.00000001\",\n        \"amount\": \"1.00000000\",\n        \"pending\": \"1.00000000\"\n    }\n]\n```\n\n###Cancel Open Order\nCancel the open order with the given ID.\n\n```java\ncancelOrder(829229545);\n```\n\n```json\ntrue\n```\n\n###Fetch Account Hash Rate\nFetch the account Hash Rate on GHash.io.\n\n```java\nhashrate();\n```\n\n```json\n{\n    \"last5m\": 0,\n    \"last15m\": 0,\n    \"last1h\": 0,\n    \"last1d\": 0,\n    \"prev5m\": 0,\n    \"prev15m\": 0,\n    \"prev1h\": 0,\n    \"prev1d\": 0\n}\n```\n\n###Fetch Worker Hash Rate\nFetch the worker Hash Rates on GHash.io.\n\n```java\nworkers();\n```\n\n```json\n{\n    \"xxx.ghash\": {\n        \"last5m\": 0,\n        \"last15m\": 0,\n        \"last1h\": 0,\n        \"last1d\": 0,\n        \"prev5m\": 0,\n        \"prev15m\": 0,\n        \"prev1h\": 0,\n        \"prev1d\": 0,\n        \"rejected\": {\n            \"stale\": 0,\n            \"duplicate\": 0,\n            \"lowdiff\": 0\n        }\n    }\n}\n```\n\n##Additional Help\n* Cex.io online API documentation: https://cex.io/api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fcex.io-api-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackurben%2Fcex.io-api-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fcex.io-api-java/lists"}