# General Programming Principal

# Upstream vs Downstresam API

All this discussion is relative based on an API that uses another API and that API is being used by another API.

[![image.png](https://wiki.tamarinne.me/uploads/images/gallery/2023-05/scaled-1680-/3ZAimage.png)](https://wiki.tamarinne.me/uploads/images/gallery/2023-05/3ZAimage.png)

##### Upstream API

You refer to API that your API uses as upstream if it produces data that YOUR API consumes in the middle.

##### Downstream API

You refer to API that depends on YOUR API as downstream. They are waiting for your output in order to process the request that they have received.

##### Some pictures

[![image.png](https://wiki.tamarinne.me/uploads/images/gallery/2023-05/scaled-1680-/WxZimage.png)](https://wiki.tamarinne.me/uploads/images/gallery/2023-05/WxZimage.png)![image.png](https://wiki.tamarinne.me/uploads/images/gallery/2023-05/scaled-1680-/Xwsimage.png)