What is an API URL Path?

Jump to:

What is an API URL Path?

An API URL Path is an address that allows you to access an API and its various features.

If you’ve ever used a computer in your life (which I’m sure you have, since you’re reading this), you should have at least some idea of what a URL is — even outside the context of APIs.

But if you don’t, URLs are what you type into the address bar to go to a website — like this:

https://apipheny.io

Believe it or not, using an API URL Path is as simple as using any URL in your web browser.

How API URL Paths work

If you’re typing https://apipheny.io into your browser’s address bar, you’re basically making a request to your browser to show you the content of our website.

Example 1

  • Request: “Show me Apipheny’s website.”
  • Method: Enter https://apipheny.io into address bar.
  • Response: The website loads.

But let’s say, instead of the Home page, you want to see Apipheny’s Support page.

To do that, you can click “Support” on the Home page menu or attach /support to the original URL.

Example 2

  • Request: “Show me Apipheny’s Support page.”
  • Method: Enter https://apipheny.io/support into address bar.
  • Response: The Support page loads.

In the context of APIs, basically the same thing is happening.

There are 2 parts to any API URL:

  1. Base URL
  2. Endpoint

The Base URL is kind of like the base address for the specific API that you’re using. Until you choose a specific Endpoint, though, the Base URL isn’t going to do much.

In Example 1, https://apipheny.io acts as the Base URL.

The Endpoint is a specific “point of entry” in an API. You attach these to the end of your Base URL and get results depending on which Endpoint you choose.

In Example 2, /support acts sort of like an Endpoint, wherein it shows you the contents of Apipheny’s Support page.

How to find API URL Paths for any API

To demonstrate how to find any API URL Path for any API, we’ll use the Cat Facts API as a beginner-friendly example.

In the Cat Facts API documentation, you’ll see this:

This tells us that the Base URL (the part we’ll need to use any of the API’s features) is:

https://cat-fact.herokuapp.com

And that there are two endpoints:

/facts

and

/users

Using this information, we can choose an endpoint that suits our needs.

If we want to get a list of cat facts, we just attach the /facts endpoint to the base URL to get the complete API URL Path:

https://cat-fact.herokuapp.com/facts.

The Base URL of any API, along with all its endpoints, should be included in the API’s documentation. If it doesn’t, the API is unusable, and you should look somewhere else.

Using the API URL Path feature in Apipheny

Here’s CEO & Co-Founder, Meelad, demonstrating how to use the Apipheny add-on. He uses an API URL Path at 0:32.

So, what’s going on there?

Well, anytime you import API data to Apipheny, you first have to enter an “API URL Path”.

This goes for both GET requests and POST requests.

POST requests need you to fill up the “POST Body”, but all you need to make a GET request is the API URL Path.

Let’s use the Cat Facts API again as an example.

So, let’s say we want to GET some good old cat facts. Here’s what we put into Apipheny:

That’s the Base URL https://cat-fact.herokuapp.com/ with the /facts endpoint attached to it, or:

https://cat-fact.herokuapp.com/facts

Clicking “Run” gives us this:

And just like that, we get a nice, organized list of cat facts — in a click of a button.

Final words

When using APIs, API URL Paths are your bread-and-butter. You literally won’t be able to do anything without them.

The Cat Facts API we used above only has 2 possible URLs, but more complex APIs will have dozens upon dozens.

In any case, it’ll do you good to take deep dives into the API documentation of any API you want to use.

If you have a good grasp of an API’s features, you’ll be surprised at how much you can do.

Import API data directly into Google Sheets

Do a lot of copy-pasting?

We used to, as well.

But it took up too much of our time.

Introducing Apipheny, a Google Sheets add-on that lets you import data directly into Google Sheets — and save up to an hour of your workday.

It lets you connect virtually any API to Google Sheets — in just a matter of seconds.

This means you can now import data directly from your favorite data sources — and finally stop switching between tabs with your fingers stuck on Ctrl + C and Ctrl + V.

Here’s Apipheny CEO & Co-Founder, Meelad, showing you just how easy it is to use the add-on.

Apipheny lets you do the following things:

  • Skip the scripting & coding part of APIs.
  • Retrieve and send data from your favorite data sources easily, using the GET and POST request features.
  • Access virtually any REST API, whether it’s JSON or CSV.
  • Get the data you need in a nice, clean, list on your spreadsheet with the JSON converter.
  • Save time by automating your API calls with the Save and Schedule features.

Try it for free. No credit card needed.

Learn more about APIs by reading these next:

Related Posts