Help

Python API 404 Errors

Topic Labels: API
Solved
Jump to Solution
2984 4
cancel
Showing results for 
Search instead for 
Did you mean: 
James_Hillegas1
4 - Data Explorer
4 - Data Explorer

I am using the Airtable Python API

With the following code I get a successful response, minus the API key I removed.

*from airtable import Airtable*
  • import os*

  • table_name = ‘PeachTree 903’;*

  • base_key = ‘app9F0yiPo2kvFBsA’;*

  • api_key = ‘’;*

  • airtable = Airtable(base_key, table_name, api_key)*

  • print(airtable)*

The response I get from the above is:
image

Which matches my table_name.

Now when I go to add this next line and run the script I get the following errors like nothing is returned which does not make any sense.

airtable.get_all()

image

Anyone solve this?

1 Solution

Accepted Solutions

Pretty sure that’s not the code that you used to get this response because it returned an object and did so without URI encoding of the table name? Very hard to believe; it should have thrown an error as it seems to be doing now.

image

Did you also remove the space from the table name in Airtable? And what was the outcome?

If you URI encode the table name, you don’t need to remove spaces.

See Solution in Thread

4 Replies 4

Hi James, and welcome to the community!

I see a few issues, but I can’t be certain because the actual code you are running is not visible here, right? You should share the actual code (without API key) so we can see exactly what’s running.

One issue is the fact that the table name includes a space. The only way for this to work is if the table name is URI encoded. Failing to do so would cause the exact issue I see in the screen shot.

James_Hillegas1
4 - Data Explorer
4 - Data Explorer

Code:

image

I did remove api key. I also took your advice and removed the space from the table name.

PS I did place code in original post, but looks like formatting got messed up and confusing.

Pretty sure that’s not the code that you used to get this response because it returned an object and did so without URI encoding of the table name? Very hard to believe; it should have thrown an error as it seems to be doing now.

image

Did you also remove the space from the table name in Airtable? And what was the outcome?

If you URI encode the table name, you don’t need to remove spaces.

I was calling the base name, not the table name. That is what thru the error in the code. Everything is working now.