# Creating a simple web application that uses ESI

**URL:** <https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461>\
**Category:** Third Party Developers\
**Created:** [October 4, 2017, 10:35pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461 "2017-10-04T22:35:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xero\_Asanari](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xero_asanari/32/383585_2.png) [@Xero\_Asanari](https://forums.eveonline.com/u/Xero_Asanari)\
**Post date:** [October 4, 2017, 10:35pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/1 "2017-10-04T22:35:08Z")

</div>

Hello,

I wish to create a simple web application that I can put on colo hardware that pulls information directly from ESI.

I would like to start out with just being able to type in an item ID or name and get all buy/sell orders.

The only problem is, I have minimal python/dev skills! I would love to learn how to do all of this, but I need some guidance as to where to get started.

I know how ESI works, you just call from a URL and it returns data (in .json form, I think?). I am struggling to understand how to get from data raw data to a useful web application. I apologize for my lack of knowledge.

I know quite a bit of HTML and some PHP, and know my way around a lamp stack. I just need someone to guide the way 🙂

---

<div class="post-metadata">

**Author:** ![Althalus\_Stenory](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/althalus_stenory/32/429792_2.png) [@Althalus\_Stenory](https://forums.eveonline.com/u/Althalus_Stenory)\
**Post date:** [October 4, 2017, 11:16pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/2 "2017-10-04T23:16:45Z")

</div>

Basically, you query an URL, parse the data it gave you, and that’s it 🙂  
In a more precise way, considering what you want to do (the basic way):

1. you have a form asking for an item ID (for the ease of explaining, i’ll take `34` for `tritanium`) and region ID (`10000002` for `The Forge`)
2. submit form with these data
3. the backend (php, python, whatever) will take these IDs, put them in the market URL, which will then become  
`https://esi.tech.ccp.is/latest/markets/10000002/orders/?datasource=tranquility&order_type=all&type_id=34`
4. the backend call that URL, and get a json array in response of your call.
5. it then loop over this data to render the page
6. the user get the current order data for `tritanium` in `The Forge`

In python, using `requests` lib for example, it’ll be something like that for step 4-5

```auto
import requests
import json

response = requests.get(`https://esi.tech.ccp.is/latest/markets/10000002/orders/?datasource=tranquility&order_type=all&type_id=34')
data = json.loads(response.content)
for row in data:
    # print whatever you want from the order data

```

That’s pretty much it. If the user have only the name of regions / items, you’ll have to get the corresponding id’s (either using SDE or ESI endpoints for this).

If you are going to use python, you can either use the examples from [here (eve dev blog)](https://developers.eveonline.com/blog) or you can use [EsiPy](https://kyria.github.io/EsiPy/) which will make your use of ESI easier (imho btw). You can find an example with EsiPy using in the doc I linked.

Edit: As for the web part, for python you have several choices. The more common are Flask and Django (each with their pro/con).

For PHP, if you go for it, it’s the same: you will just have a php page that call ESI (using PHP Curl), parsing the response and giving it back to the user.

---

<div class="post-metadata">

**Author:** ![Snitch\_Ashor](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/snitch_ashor/32/470084_2.png) [@Snitch\_Ashor](https://forums.eveonline.com/u/Snitch_Ashor)\
**Post date:** [October 4, 2017, 11:18pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/3 "2017-10-04T23:18:11Z")

</div>

If you have some python skills, I suggest you pick a framework to run the actual webpage (django or flask, just to name a few) and do the tutorial. Django actually has a pretty good one:  
[https://docs.djangoproject.com/en/1.11/intro/tutorial01/](https://docs.djangoproject.com/en/1.11/intro/tutorial01/)

---

<div class="post-metadata">

**Author:** ![Xero\_Asanari](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xero_asanari/32/383585_2.png) [@Xero\_Asanari](https://forums.eveonline.com/u/Xero_Asanari)\
**Post date:** [October 5, 2017, 1:05pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/4 "2017-10-05T13:05:46Z")

</div>

Thanks! I think I am going to go with a simple PHP page for now and just parse the response data.

I like how Fuzzmarket works, especially on the front end how he separated logic pages from the display pages. I will probably expand on that for the front-end, save myself some time.

Another question, what packages will I need specifically on an Ubuntu build to run a python/php combo? I was think build-essential and your typical lamp stack and FTP (trying to keep it light).

Again, thanks for tolerating my baby questions.

Edit: I would appreciate the dependencies for FuzzMarket, as it looks like I am going to end up running a very similary structure 🙂

---

<div class="post-metadata">

**Author:** ![Snitch\_Ashor](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/snitch_ashor/32/470084_2.png) [@Snitch\_Ashor](https://forums.eveonline.com/u/Snitch_Ashor)\
**Post date:** [October 5, 2017, 2:24pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/5 "2017-10-05T14:24:00Z")

</div>

Fuzzmarket is open source and you should be able to install the dependencies via composer:

> **[fuzzysteve/FuzzMarket](https://github.com/fuzzysteve/FuzzMarket)**
>
> FuzzMarket - Eve market data site

---

<div class="post-metadata">

**Author:** ![Althalus\_Stenory](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/althalus_stenory/32/429792_2.png) [@Althalus\_Stenory](https://forums.eveonline.com/u/Althalus_Stenory)\
**Post date:** [October 5, 2017, 3:58pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/6 "2017-10-05T15:58:01Z")

</div>

> [@Xero\_Asanari](#):
>
> Another question, what packages will I need specifically on an Ubuntu build to run a python/php combo? I was think build-essential and your typical lamp stack and FTP (trying to keep it light).

If you want python, you’ll need “at least” (imho) python, python-dev, virtualenv packages. You’ll also need a web application server for web python app (like uwsgi, gunicorn…). For python dependencies, within a virtualenv you can just use `pip`  
For php, if you have lamp, just also install `composer` for dependency management

---

<div class="post-metadata">

**Author:** ![Xero\_Asanari](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xero_asanari/32/383585_2.png) [@Xero\_Asanari](https://forums.eveonline.com/u/Xero_Asanari)\
**Post date:** [October 6, 2017, 5:07am UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/7 "2017-10-06T05:07:49Z")

</div>

Okay, to be honest I have no earthly idea what I am doing (Domain sysadmin here, never really learned any of this stuff)

Lets start with the script he uses to aggregate the data from ESI.

```
from sqlalchemy import create_engine, Column, MetaData, Table, Index
from sqlalchemy import Integer, String, Text, Float, Boolean, BigInteger, Numeric, SmallInteger, DateTime
import time
import requests
from requests_futures.sessions import FuturesSession
import requests_futures
from concurrent.futures import as_completed
import datetime
import csv
import time
import sys
import re
import pandas
import numpy
import redis
import json
import os
import shutil
import base64

```

What is happening here? I get that python is grabbing something, but what is it grabbing, why is it grabbing it, and where is it grabbing it from? That would go a long way to help me understand the basics of how this works.

I assume that this script is heavily dependent on whatever is contained in the stuff that python is grabbing?

---

<div class="post-metadata">

**Author:** ![Althalus\_Stenory](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/althalus_stenory/32/429792_2.png) [@Althalus\_Stenory](https://forums.eveonline.com/u/Althalus_Stenory)\
**Post date:** [October 7, 2017, 9:25am UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/8 "2017-10-07T09:25:42Z")

</div>

According to what you pasts, this only includes libs (unless you forgot to paste something :p)  
From what I see here, it requires a few external libs (pandas, numpy, redis, shutil, requests, sqlalchemy).

`import <module>` and `from <package> import <module>` are just ways to include libs within a python module (a module is a “file”, a package is a collection of module (a folder containing python files)

Tbh, if you want to learn python try to find / read / follow some tutorials or courses. It’s not hardest language to learn. A few links:

- [https://docs.python.org/3/tutorial/index.html](https://docs.python.org/3/tutorial/index.html)
- [https://www.codementor.io/sheena/python-path-virtualenv-import-for-beginners-du107r3o1](https://www.codementor.io/sheena/python-path-virtualenv-import-for-beginners-du107r3o1)
- [https://packaging.python.org/tutorials/installing-packages/](https://packaging.python.org/tutorials/installing-packages/)
- [http://thepythonguru.com/](http://thepythonguru.com/)
- [https://github.com/vinta/awesome-python](https://github.com/vinta/awesome-python)

Some are probably not the best links, but it might still help.

---

<div class="post-metadata">

**Author:** ![Xero\_Asanari](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xero_asanari/32/383585_2.png) [@Xero\_Asanari](https://forums.eveonline.com/u/Xero_Asanari)\
**Post date:** [October 9, 2017, 12:58pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/9 "2017-10-09T12:58:35Z")

</div>

Despite using composer to ensure I have all the dependencies for FuzzMarket, it still simply will not work. Either FuzzySteve left something out or I left something out, but this should be fairly simple yet it refuses to cooperate.

---

<div class="post-metadata">

**Author:** ![Xero\_Asanari](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/xero_asanari/32/383585_2.png) [@Xero\_Asanari](https://forums.eveonline.com/u/Xero_Asanari)\
**Post date:** [October 9, 2017, 3:48pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/10 "2017-10-09T15:48:07Z")

</div>

Finally got it working, do not rely on composer, the dependencies it installed were not the correct ones. I am on a mission to document this sucker!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [January 7, 2018, 3:48pm UTC](https://forums.eveonline.com/t/creating-a-simple-web-application-that-uses-esi/29461/11 "2018-01-07T15:48:33Z")

</div>

Closed on January 7, 2018, 3:48pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
