Print

What is an API URL?

Contents

  1. What is an API URL?
  2. How is an API URL structured?
  3. How to find API URLs?
  4. How to use the API URL?

What is an API URL?

As you probably already know, a URL is what you see in the address bar of your browser, e.g. https://mixedanalytics.com/api-connector/

urls-addressbar

When you type that URL into your browser, you're making a request to our servers, which respond by showing you the content of our website.

An API URL is exactly the same! However, instead of sending back a website, the application server will send you back an API response.

How is an API URL structured?

An API URL is structured exactly like a "regular" website URL, but the naming conventions are a bit different, and they typically adhere to a stricter organizational logic. There are 3 parts to an API URL:

  1. The base URL. The base URL is the initial part of the API URL. Typically all API requests to that API will use the same base URL. For example, Stripe's base URL is https://api.stripe.com/v1/
  2. The endpoint. The endpoint identifies which resource you want to access. For example, Stripe has endpoints for /balance, /charges, /customers, and so on.
  3. Query parameters. Query parameters come after an initial question mark, and are generally used to filter or customize the API request. For example, Stripe's API supports including ?limit=100 to fetch 100 records. (Note: not all API URLs use query parameters; some APIs don't allow customized queries, or customize the request via the request body instead).

The full API URL will combine these 3 segments into a complete URL, e.g. https://api.stripe.com/v1/charges?limit=100

If you have multiple query parameters, subsequent parameters will be separated with an ampersand, e.g. https://api.stripe.com/v1/charges?limit=100&after=123456

How to find API Request URLs?

To find your API request URL, you'll need to check the API documentation for your API of interest.

For example, here's the API documentation for the CryptingUp API. It shows the base URL right at the top:
urls-baseurl

Below that they clearly show the endpoints and any available parameters:
urls-parameters

Depending on the API's complexity and the strength of its documentation, available endpoints and parameters may be more or less easy to discover, but everything you need should be right there in the docs.

How to use the API Request URL?

The API request URL is the basic building block of any modern API, so most coding languages will have a method (or plugin) that allows you to construct API requests and input your API URL.

For example, you're using your terminal, you can include the URL as a curl command, e.g. curl -X GET "https://store.myshopify.com/admin/api/2023-10/orders.json?status=any" \
-H "X-Shopify-Access-Token: {access_token}"

If you're using a no-code tool like Postman or API Connector for Sheets, you can copy and paste the API URL into the request URL field, like this:
urls-response

4 thoughts on “What is an API URL?”

Leave a Comment

Jump To