Consulti Posted March 17, 2020 Share Posted March 17, 2020 Hello everyone , I'm currently working on a project and I'm having a hard time finding an update G.E API for osrs that contains the product image so I can have both updated value and image for my website, do you guys have any idea where I can get both? For the G.E API, I'm using the one provided by rsbuddy (open for better suggestions) and for the item image, I'd need to make a call to get the item icon from services.runescape Do you guys have any suggestion to make this process easier? Quote Link to comment Share on other sites More sharing options...
Apaec Posted March 17, 2020 Share Posted March 17, 2020 (edited) I'd use the official GE API: https://www.reddit.com/r/2007scape/comments/3g06rq/guide_using_the_old_school_ge_page_api/ That way you're not relying on a third party like RSBuddy for your data. -Apa Edited March 17, 2020 by Apaec Quote Link to comment Share on other sites More sharing options...
ez11 Posted March 17, 2020 Share Posted March 17, 2020 There is only the offical and the rsbuddy ge api. And the rsbuddy ge api is kinda garbage since rsbuddy has a super low playercount and anyone can just send them false data and manipulate prices (which is why runelite doesnt track their users ge data). Quote Link to comment Share on other sites More sharing options...
Consulti Posted March 17, 2020 Author Share Posted March 17, 2020 Fair enough. I was expecting rsbuddy to be quite popular and reliable since everyone suggests to use that instead! Thanks for the help guys, will take a look on the reddit post suggested by @Apaec Quote Link to comment Share on other sites More sharing options...
Consulti Posted June 19, 2020 Author Share Posted June 19, 2020 Hello everyone, I'd like to revive this topic as me and some friends are getting back to this idea to play around. Unfortunately, the reddit post provided by Apaec is a bit outdated, is there any other suggestion available at the moment? I'm trying to get high quality images of each item, like the ones provided by https://oldschool.runescape.wiki/ and a valid G.E API to fetch the prices, so the problem here is: Finding the items database; Link them to a valid website with images that we can download; G.E value of each one of these items. Do you have any suggestion for that? Quote Link to comment Share on other sites More sharing options...
Nbacon Posted June 19, 2020 Share Posted June 19, 2020 (edited) This is my code for One of my ge merchers I cant find my Id-> price code https://prnt.sc/sdtqu3 https://prnt.sc/sdtr35 Query -> sub-set of data-base textField1.getDocument().addDocumentListener(new DocumentListener(){ @Override public void insertUpdate(DocumentEvent e) { String text = textField1.getText(); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void removeUpdate(DocumentEvent e) { String text = textField1.getText(); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void changedUpdate(DocumentEvent e) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }); Clicking on item -> name/id table1.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { int row = table1.rowAtPoint(evt.getPoint()); int col = table1.columnAtPoint(evt.getPoint()); if (row >= 0 && col >= 0) { table1.getValueAt( row, col); ItemName.setText((String) table1.getValueAt( row, 0)); } } }); Id-> Item (might want to add 1 more hash map that is <string,Items> to do name-> item->id ) public class ItemGuide { private static final Map<Long, Item> allGEItems = new HashMap<>(); private static final List<Object[]> GeItems= new ArrayList<>(); public static Object[][] getAllGEItems() { if (allGEItems.isEmpty()) { File summaryFile = Paths.get(System.getProperty("user.home"), "OSBot", "Data", "items-cache-data.json").toFile(); try { if (!summaryFile.exists()) { URL website = new URL("https://raw.githubusercontent.com/osrsbox/osrsbox-db/master/data/items/items-cache-data.json"); ReadableByteChannel rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream(summaryFile); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } try (FileReader fileReader = new FileReader(summaryFile)) { JSONObject jsonObject = (JSONObject) (new JSONParser().parse(fileReader)); for (Object value : jsonObject.values()) { JSONObject item = (JSONObject) value; if ((Boolean) item.get("tradeable_on_ge")){ allGEItems.put((Long) item.get("id"),new Item().setId((Long) item.get("id")) .setMembers((Boolean) item.get("members")) .setName((String) item.get("name")) ); } } } } catch (IOException | ParseException e) { e.printStackTrace(); } summaryFile = Paths.get(System.getProperty("user.home"), "OSBot", "Data", "ge-limits-ids.json").toFile(); try { if (!summaryFile.exists()) { URL website = new URL("https://raw.githubusercontent.com/osrsbox/osrsbox-db/master/data/items/ge-limits-ids.json"); ReadableByteChannel rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream(summaryFile); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } try (FileReader fileReader = new FileReader(summaryFile)) { JSONObject jsonObject = (JSONObject) (new JSONParser().parse(fileReader)); for (Object value : jsonObject.keySet()) { if (allGEItems.containsKey(Long.valueOf((String) value) )){ System.out.println(jsonObject.get(value)); if (jsonObject.get(value)!=null){ allGEItems.get(Long.valueOf((String) value)).setBuyLimit((Long) jsonObject.get(value)); }else { allGEItems.get(Long.valueOf((String) value)).setBuyLimit(-1); } } } } } catch (IOException | ParseException e) { e.printStackTrace(); } } allGEItems.values().forEach(s->GeItems.add(s.getItem())); Object[][] array2d = GeItems.toArray(new Object[GeItems.size()][]); return array2d; } public static Map<Long, Item> getGeItems() { if (allGEItems.isEmpty()){ getAllGEItems(); } return allGEItems; } } Id -> Image Image image =null; private void drawitem(){ if (image ==null){ URL url = null; try { url = new URL("https://rsbuddy.com/items/" + itemid+".png"); } catch (MalformedURLException e) { e.printStackTrace(); } try { image = ImageIO.read(url); } catch (IOException e) { e.printStackTrace(); } } Graphics g = c.getGraphics(); Graphics2D g2 = (Graphics2D) g; if (image!=null){ g.drawImage(image, 55, 50,60,60,null ); g.setColor(lowlites); g2.setStroke(new BasicStroke(3)); }else { drawText("ERROR", 50 ,50,Color.white,font1); } g2.setStroke(new BasicStroke(1)); g.setColor(Color.black); g2.draw(new RoundRectangle2D.Double(50, 50, 60, 60, 10, 10)); } Edited June 19, 2020 by Nbacon Quote Link to comment Share on other sites More sharing options...
Consulti Posted June 19, 2020 Author Share Posted June 19, 2020 11 hours ago, Nbacon said: This is my code for One of my ge merchers I cant find my Id-> price code https://prnt.sc/sdtqu3 https://prnt.sc/sdtr35 Query -> sub-set of data-base textField1.getDocument().addDocumentListener(new DocumentListener(){ @Override public void insertUpdate(DocumentEvent e) { String text = textField1.getText(); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void removeUpdate(DocumentEvent e) { String text = textField1.getText(); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void changedUpdate(DocumentEvent e) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }); Clicking on item -> name/id table1.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { int row = table1.rowAtPoint(evt.getPoint()); int col = table1.columnAtPoint(evt.getPoint()); if (row >= 0 && col >= 0) { table1.getValueAt( row, col); ItemName.setText((String) table1.getValueAt( row, 0)); } } }); Id-> Item (might want to add 1 more hash map that is <string,Items> to do name-> item->id ) public class ItemGuide { private static final Map<Long, Item> allGEItems = new HashMap<>(); private static final List<Object[]> GeItems= new ArrayList<>(); public static Object[][] getAllGEItems() { if (allGEItems.isEmpty()) { File summaryFile = Paths.get(System.getProperty("user.home"), "OSBot", "Data", "items-cache-data.json").toFile(); try { if (!summaryFile.exists()) { URL website = new URL("https://raw.githubusercontent.com/osrsbox/osrsbox-db/master/data/items/items-cache-data.json"); ReadableByteChannel rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream(summaryFile); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } try (FileReader fileReader = new FileReader(summaryFile)) { JSONObject jsonObject = (JSONObject) (new JSONParser().parse(fileReader)); for (Object value : jsonObject.values()) { JSONObject item = (JSONObject) value; if ((Boolean) item.get("tradeable_on_ge")){ allGEItems.put((Long) item.get("id"),new Item().setId((Long) item.get("id")) .setMembers((Boolean) item.get("members")) .setName((String) item.get("name")) ); } } } } catch (IOException | ParseException e) { e.printStackTrace(); } summaryFile = Paths.get(System.getProperty("user.home"), "OSBot", "Data", "ge-limits-ids.json").toFile(); try { if (!summaryFile.exists()) { URL website = new URL("https://raw.githubusercontent.com/osrsbox/osrsbox-db/master/data/items/ge-limits-ids.json"); ReadableByteChannel rbc = Channels.newChannel(website.openStream()); FileOutputStream fos = new FileOutputStream(summaryFile); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } try (FileReader fileReader = new FileReader(summaryFile)) { JSONObject jsonObject = (JSONObject) (new JSONParser().parse(fileReader)); for (Object value : jsonObject.keySet()) { if (allGEItems.containsKey(Long.valueOf((String) value) )){ System.out.println(jsonObject.get(value)); if (jsonObject.get(value)!=null){ allGEItems.get(Long.valueOf((String) value)).setBuyLimit((Long) jsonObject.get(value)); }else { allGEItems.get(Long.valueOf((String) value)).setBuyLimit(-1); } } } } } catch (IOException | ParseException e) { e.printStackTrace(); } } allGEItems.values().forEach(s->GeItems.add(s.getItem())); Object[][] array2d = GeItems.toArray(new Object[GeItems.size()][]); return array2d; } public static Map<Long, Item> getGeItems() { if (allGEItems.isEmpty()){ getAllGEItems(); } return allGEItems; } } Id -> Image Image image =null; private void drawitem(){ if (image ==null){ URL url = null; try { url = new URL("https://rsbuddy.com/items/" + itemid+".png"); } catch (MalformedURLException e) { e.printStackTrace(); } try { image = ImageIO.read(url); } catch (IOException e) { e.printStackTrace(); } } Graphics g = c.getGraphics(); Graphics2D g2 = (Graphics2D) g; if (image!=null){ g.drawImage(image, 55, 50,60,60,null ); g.setColor(lowlites); g2.setStroke(new BasicStroke(3)); }else { drawText("ERROR", 50 ,50,Color.white,font1); } g2.setStroke(new BasicStroke(1)); g.setColor(Color.black); g2.draw(new RoundRectangle2D.Double(50, 50, 60, 60, 10, 10)); } So, you are getting item ID from osrsbox, item image from rsbuddy, if tradeable or not and G.E limits but where does the G.E price come from? Also, the item image is just the icon wanted to get a high quality one like this: https://oldschool.runescape.wiki/images/thumb/3/30/Abyssal_whip_detail.png/800px-Abyssal_whip_detail.png?70893 Quote Link to comment Share on other sites More sharing options...
Nbacon Posted June 19, 2020 Share Posted June 19, 2020 4 hours ago, Consulti said: So, you are getting item ID from osrsbox, item image from rsbuddy, if tradeable or not and G.E limits but where does the G.E price come from? Also, the item image is just the icon wanted to get a high quality one like this: https://oldschool.runescape.wiki/images/thumb/3/30/Abyssal_whip_detail.png/800px-Abyssal_whip_detail.png?70893 I can count the amount of polygones of an rs item on 1 hand why do you need 80kb images? There is around 10k items and 4k tradeable items all of those with high qualty images is between 300mb - 800. That is alot. Get the prices like https://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=*ID* Quote Link to comment Share on other sites More sharing options...
Consulti Posted June 19, 2020 Author Share Posted June 19, 2020 1 minute ago, Nbacon said: I can count the amount of polygones of an rs item on 1 hand why do you need 80kb images? There is around 10k items and 4k tradeable items all of those with high qualty images is between 300mb - 800. That is alot. Get the prices like https://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=*ID* We wanna animate the item like zoom in/out, check specific details but for that, the image needs to be big and in HD, the icon currently offered are too small for that. The file size is not a big deal since we won't load it all at once, just the 4k tradeable item and the user would have access 1 by 1. Thanks for the price suggestion, is https://rsbuddy.com/exchange/summary.json still reliable? Quote Link to comment Share on other sites More sharing options...
Nbacon Posted June 19, 2020 Share Posted June 19, 2020 *Zooms in* HMMMMM... Still a whip but bigger. 12 minutes ago, Consulti said: is https://rsbuddy.com/exchange/summary.json still reliable? for prices no. Quote Link to comment Share on other sites More sharing options...
Consulti Posted June 20, 2020 Author Share Posted June 20, 2020 19 hours ago, Nbacon said: *Zooms in* HMMMMM... Still a whip but bigger. for prices no. Yeah, but anyway, I guess there's no easy way for that currently. Regarding rsbuddy, I really thought they were the most reliable due to ge-tracker using their system? Thanks for letting me know. Quote Link to comment Share on other sites More sharing options...