# About transit app

**URL:** <https://community.thunkable.com/t/about-transit-app/497306>\
**Category:** Questions about Thunkable X\
**Created:** [March 4, 2020, 7:20am UTC](https://community.thunkable.com/t/about-transit-app/497306 "2020-03-04T07:20:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceace20172](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@iceace20172](https://community.thunkable.com/u/iceace20172)\
**Post date:** [March 4, 2020, 7:20am UTC](https://community.thunkable.com/t/about-transit-app/497306/1 "2020-03-04T07:20:52Z")

</div>

I want to made transit app. This app can track real time and see route of a car in one screen. Can I made it with thunkable ?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [March 4, 2020, 7:31am UTC](https://community.thunkable.com/t/about-transit-app/497306/2 "2020-03-04T07:31:55Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![iceace20172](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@iceace20172](https://community.thunkable.com/u/iceace20172)\
**Post date:** [March 4, 2020, 7:53am UTC](https://community.thunkable.com/t/about-transit-app/497306/3 "2020-03-04T07:53:16Z")

</div>

Do you have some reference or tutorial I so new on this.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 4, 2020, 8:42am UTC](https://community.thunkable.com/t/about-transit-app/497306/4 "2020-03-04T08:42:53Z")

</div>

you can start with this (my first app). on start, the app gathers alerts and notifications in the system, if any, then displays the number of trains currently in the system.  
in order to do this, our transit system, BART (bay area transit system), has made their API ([api.bart.gov/](http://api.bart.gov/)) available for querying the system via the web.  
my first app uses two of the simplest calls to the API. you can read the doc , and study the code, so you can see how to set up the call, then how to process the return data (which luckily is available in JSON format).  
here is a copy of the project: [https://x.thunkable.com/copy/bfc841793b8b16d18b8e4595259fdf3c](https://x.thunkable.com/copy/bfc841793b8b16d18b8e4595259fdf3c)  
when you are ready to handle the structured format of live data (train data). i can share my other BART app, which displays the trains arriving at any time, at any BART station (of your choice).  
good luck!

---

<div class="post-metadata">

**Author:** ![iceace20172](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@iceace20172](https://community.thunkable.com/u/iceace20172)\
**Post date:** [March 4, 2020, 11:12am UTC](https://community.thunkable.com/t/about-transit-app/497306/5 "2020-03-04T11:12:05Z")

</div>

Thank but i still confuse.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 4, 2020, 11:47am UTC](https://community.thunkable.com/t/about-transit-app/497306/6 "2020-03-04T11:47:43Z")

</div>

try studying how this app [https://x.thunkable.com/projects/5e46212bed3a9fd9b0f28461/7e0effbc-113a-431c-a0b8-20530d9e9f04/designer](https://x.thunkable.com/projects/5e46212bed3a9fd9b0f28461/7e0effbc-113a-431c-a0b8-20530d9e9f04/designer) was coded. it shows how a call is made to the API with city name, how to obtain a specific json field and how to display it. it can even show a map, based on the longitude and latitude of the city selected. i hope this helps.

As a matter of fact, THIS is the app I remixed in order to make my bart advisory app!

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 5, 2020, 6:17am UTC](https://community.thunkable.com/t/about-transit-app/497306/7 "2020-03-05T06:17:29Z")

</div>

Let me try one more time with a simpler example.

BART (san francisco bay area rapid transit) has made an API (application program interface) available to allow anyone to perform queries about the system by typing a special form of URL and supplying the needed parameters. let’s say we want to request the number of trains active in the system. you can go to [http://api.bart.gov/](http://api.bart.gov/), click Advisories, click count, to see how to formulate the url. it happens to be:

**[http://api.bart.gov/api/bsa.aspx?cmd=count&json=y&key=MW9S-E7SL-26DU-VV8V](http://api.bart.gov/api/bsa.aspx?cmd=count&json=y&key=MW9S-E7SL-26DU-VV8V)**

(the json and key parts must always be supplied - the key is the public key for the API)

when we enter this url in the browser we get this response:  
 ![barttc1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/a/6a9853440dc1ecd98eb1bdbb7bf4148f7b7b7263.png)

it is a display of a “tree” with two branches: “?xml” and “root”, which itself expands into five branches namely: uri, date, time, traincount, message. in JSON, the tree is called response while a branch is called property.  
so the field we want is the value of the property called ‘ **traincount** ’ which is part of the property called ‘ **root** ’ which is part of the original object called ‘ **response** ’.

i have created a small app that performs this function only. see below.  
[https://x.thunkable.com/copy/bb7ae8ec66837e92acefa0bcf5ba4ebb](https://x.thunkable.com/copy/bb7ae8ec66837e92acefa0bcf5ba4ebb)

 ![barttc2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/959cfbe7760708847b571bc20acc123c35dcfff0.png)

the blocks above show how it is coded in thunkable - we formulate the query into a url string as defined above, then we “GET” the url to perform the API request, then we process the JSON response, almost word for word as described in the last paragraph.

regarding your project of showing the path of any route, you need to find out if the transit system at your location has provided an API for making queries against the system. the BART API contains queries about a routeinfo which is made up of several stations. there is a query for stninfo which can return the longitude and latitude of the station. and the map component has a capability of drawing markers and polylines on a map. i believe it is possible to draw the path of any train route in the system using the capabilities of the API and the features of the map component…

you’ll need to be familiar in handling the formats of the various JSON responses. you can look at the tutorials for more examples.

good luck.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [March 5, 2020, 9:31am UTC](https://community.thunkable.com/t/about-transit-app/497306/8 "2020-03-05T09:31:57Z")

</div>

Thanks for sharing this @manyone - it a really helpful resource for the community, much appreciated!

---

<div class="post-metadata">

**Author:** ![iceace20172](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@iceace20172](https://community.thunkable.com/u/iceace20172)\
**Post date:** [March 6, 2020, 7:34am UTC](https://community.thunkable.com/t/about-transit-app/497306/9 "2020-03-06T07:34:06Z")

</div>

My transit system dont have API what I should do ?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 6, 2020, 8:53am UTC](https://community.thunkable.com/t/about-transit-app/497306/10 "2020-03-06T08:53:15Z")

</div>

Then you’ve got a big job ahead of you!

Assuming your transit system is like this.  
 ![transit](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/6/d65b718e264540498a1e9c009f31e06fb0ddad6e.png)  
If all you want to do is draw the path of a route, then you need to define at least 2 database tables:

STNS – table of stations, each row containing station id, name, latitude, longitude  
ROUTES – table of routes, each row defining the stations in sequence to complete the route.

“A-C” , [A,B,C]  
“C-G” , [C,D,E,F,G]  
“G-A” , [G,H,I,A]

Then when you get a route from input, look up the ROUTES table and iterate over the list of stations corresponding to that route, and for each station, look up the STNS to get the latitude and longitude for that station, then call Map.AddMarker to place a marker on the map. You’ll need to repeat the process but call Map.addPolyLine to draw the path.

I’ve never actually done this myself but the methods available in the Map component seem to suggest that it will work.

Good luck!

---

<div class="post-metadata">

**Author:** ![iceace20172](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@iceace20172](https://community.thunkable.com/u/iceace20172)\
**Post date:** [March 6, 2020, 9:17am UTC](https://community.thunkable.com/t/about-transit-app/497306/11 "2020-03-06T09:17:55Z")

</div>

Can i custom marker ?

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 6, 2020, 5:20pm UTC](https://community.thunkable.com/t/about-transit-app/497306/12 "2020-03-06T17:20:50Z")

</div>

As far as I know, we can only use 1 marker in x thunkable, it’s the red circle pointing down as if it’s saying, “look here below”. No other option.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:40am UTC](https://community.thunkable.com/t/about-transit-app/497306/14 "2024-11-08T11:40:32Z")

</div>


