liveBook · Manning

Endpoint

As explained in Build Python Web Apps with Streamlit

An endpoint is an API-specific address identifying a particular operation or resource.

An endpoint is the API-specific part of an address. While a base address identifies the service, an endpoint identifies the kind of request, such as a weather forecast, historical data, or generated text. section 5.3.1

https://<base address>/<endpoint>

Read an API address as a shared base address followed by the operation-specific endpoint. section 5.3.1

Requests can customize an endpoint with key-value parameters, such as a date, and may include information such as an API key in HTTP headers. The service returns a response, often JSON, that code can parse. For example, a weather API might expose forecast and history endpoints, while OpenAI provides a chat completions endpoint for generating the next response from a conversation. In Python, the OpenAI client calls that endpoint and reads the returned message. section 5.3.1 section 9.2.3

How Build Python Web Apps with Streamlit covers it

How deep it goes
Defines endpoint structure and demonstrates parameters and a Python call, without examining endpoint implementation internals.
Examples
Demonstrates weather forecast and history endpoints, a dated forecast URL, and OpenAI's chat completions endpoint.
What you can do after
Apply it via HTTP URLs or the OpenAI Python client to select an API operation and interpret its response.
How it connects
Connects endpoints with APIs, base addresses, HTTP requests, URL parameters, headers, API keys, JSON, and chat completions.

Also explained in

Compare how 26 books explain endpoint →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.