ivanstan / tle-api

Backend for TLE API on api.nasa.gov
https://api.nasa.gov
GNU General Public License v3.0
5 stars 1 forks source link

403 responds search query #258

Open AdrianoWeid opened 7 months ago

AdrianoWeid commented 7 months ago

i always get a 403 responds i tried everything. I always get the same data as a responds. This is my request with python. When i copy the link in my browser i see the right data. But all my requests get the respond 403 and the data below:

import requests

def search_iss():
    base_url = "http://tle.ivanstanojevic.me/api/tle"
    search_query = "ISS (ZARYA)"
    params = {'search': search_query}

    response = requests.get(base_url, params=params)
    print(response.status_code)

if __name__ == "__main__":
    search_iss()

data: adriano@MacBook-Pro-von-Adriano test % /usr/local/bin/python3 /Users/adriano/Projekte/test/test.py {"@context":"https:\/\/www.w3.org\/ns\/hydra\/context.jsonld","@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/","@type":"Tle[]","totalItems":14544,"member":[{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/25544","@type":"Tle","satelliteId":25544,"name":"ISS (ZARYA)","date":"2024-03-04T16:10:12+00:00","line1":"1 25544U 98067A 24064.67375914 .00015250 00000+0 27830-3 0 9993","line2":"2 25544 51.6410 113.3520 0005820 325.6402 181.8190 15.49612634442347"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/43694","@type":"Tle","satelliteId":43694,"name":"PROXIMA I","date":"2024-03-04T12:09:08+00:00","line1":"1 43694U 18088E 24064.50634997 .00118555 00000+0 11505-2 0 9998","line2":"2 43694 85.0103 247.5681 0006926 288.6107 71.4406 15.65932875296249"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/42826","@type":"Tle","satelliteId":42826,"name":"NORSAT 1","date":"2023-12-28T12:04:24+00:00","line1":"1 42826U 17042B 23362.50305728 .00005191 00000+0 45998-3 0 9995","line2":"2 42826 97.3809 189.6376 0012000 291.5946 68.3998 14.96586479351561"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/47966","@type":"Tle","satelliteId":47966,"name":"CENTAURI-3 (TYVAK-0210)","date":"2024-03-04T11:19:59+00:00","line1":"1 47966U 21023B 24064.47221308 .00089646 00000+0 20094-2 0 9992","line2":"2 47966 45.0067 107.8187 0007042 32.0502 328.0814 15.42460576163234"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/28654","@type":"Tle","satelliteId":28654,"name":"NOAA 18","date":"2024-03-04T13:30:55+00:00","line1":"1 28654U 05018A 24064.56314132 .00000248 00000+0 15638-3 0 9999","line2":"2 28654 98.8815 142.3800 0014056 4.1677 355.9610 14.13136199968397"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/43786","@type":"Tle","satelliteId":43786,"name":"ITASAT","date":"2024-03-04T10:19:27+00:00","line1":"1 43786U 18099AE 24064.43017361 .00007081 00000+0 53511-3 0 9999","line2":"2 43786 97.5271 124.7145 0017108 353.9106 6.1909 15.02557058286839"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/42828","@type":"Tle","satelliteId":42828,"name":"NORSAT 2","date":"2024-03-04T11:32:40+00:00","line1":"1 42828U 17042D 24064.48102162 .00009656 00000+0 79259-3 0 9998","line2":"2 42828 97.3833 255.9933 0014034 61.9483 298.3159 14.99323108361724"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/42759","@type":"Tle","satelliteId":42759,"name":"ZHUHAI-1 02 (CAS-4B)","date":"2024-03-04T12:35:02+00:00","line1":"1 42759U 17034B 24064.52433944 .00014122 00000+0 57841-3 0 9999","line2":"2 42759 43.0125 96.2014 0011212 8.9028 351.2019 15.24093453371413"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/42792","@type":"Tle","satelliteId":42792,"name":"ROBUSTA 1B","date":"2023-10-16T17:36:48+00:00","line1":"1 42792U 17036AD 23289.73389548 .09781629 23598-5 10320-2 0 9994","line2":"2 42792 97.0969 333.1645 0009033 260.0160 100.0120 16.37602079352297"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/42017","@type":"Tle","satelliteId":42017,"name":"NAYIF-1 (EO-88)","date":"2023-07-17T15:27:12+00:00","line1":"1 42017U 17008BX 23198.64389602 .03845235 23435-5 12955-2 0 9997","line2":"2 42017 97.1939 272.0619 0014074 261.3029 98.6670 16.25423645358325"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/40075","@type":"Tle","satelliteId":40075,"name":"AISSAT 2","date":"2023-12-28T11:59:02+00:00","line1":"1 40075U 14037G 23362.49933056 .00003465 00000+0 40707-3 0 9994","line2":"2 40075 98.3401 268.4723 0004780 335.0232 25.0749 14.85601820512563"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/33499","@type":"Tle","satelliteId":33499,"name":"KKS-1 (KISEKI)","date":"2024-03-04T14:05:49+00:00","line1":"1 33499U 09002H 24064.58737938 .00001942 00000+0 27524-3 0 9993","line2":"2 33499 98.1488 325.0293 0009990 104.7771 255.4546 14.78185327812666"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/33591","@type":"Tle","satelliteId":33591,"name":"NOAA 19","date":"2024-03-04T13:41:59+00:00","line1":"1 33591U 09005A 24064.57082712 .00000236 00000+0 15114-3 0 9998","line2":"2 33591 99.0622 119.2056 0013248 224.0069 136.0048 14.12939124776598"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/36797","@type":"Tle","satelliteId":36797,"name":"AISSAT 1","date":"2024-03-04T13:40:23+00:00","line1":"1 36797U 10035C 24064.56971509 .00002643 00000+0 27781-3 0 9991","line2":"2 36797 98.2014 282.2058 0009194 292.4789 67.5453 14.90349257739585"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/25338","@type":"Tle","satelliteId":25338,"name":"NOAA 15","date":"2024-03-04T14:08:27+00:00","line1":"1 25338U 98030A 24064.58920250 .00000229 00000+0 11280-3 0 9995","line2":"2 25338 98.5814 93.8468 0009220 269.9539 90.0585 14.26505516342272"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/43809","@type":"Tle","satelliteId":43809,"name":"CENTAURI-1","date":"2024-03-04T14:25:07+00:00","line1":"1 43809U 18099BD 24064.60077727 .00004523 00000+0 34677-3 0 9996","line2":"2 43809 97.5416 124.8754 0018441 321.5623 38.4287 15.02180103286570"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/43696","@type":"Tle","satelliteId":43696,"name":"PROXIMA II","date":"2024-03-04T12:02:03+00:00","line1":"1 43696U 18088G 24064.50143284 .00113676 00000+0 11328-2 0 9996","line2":"2 43696 85.0090 247.6989 0006766 286.3647 73.6874 15.65280840296223"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/48272","@type":"Tle","satelliteId":48272,"name":"NORSAT 3","date":"2023-12-28T10:31:07+00:00","line1":"1 48272U 21034E 23362.43828188 .00004841 00000+0 48553-3 0 9995","line2":"2 48272 97.6838 64.9893 0002115 110.5617 249.5829 14.91778587144752"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/35681","@type":"Tle","satelliteId":35681,"name":"DEIMOS-1","date":"2024-03-04T12:42:02+00:00","line1":"1 35681U 09041A 24064.52919951 .00000844 00000+0 13850-3 0 9999","line2":"2 35681 97.6785 252.0806 0002086 45.4938 314.6441 14.73051970783906"},{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/39070","@type":"Tle","satelliteId":39070,"name":"TDRS 11","date":"2024-03-04T12:54:42+00:00","line1":"1 39070U 13004A 24064.53799501 .00000087 00000+0 00000+0 0 9995","line2":"2 39070 2.7083 7.8487 0004806 33.2729 141.2204 1.00280531 38329"}],"parameters":{"search":"*","sort":"popularity","sort-dir":"desc","page":1,"page-size":20},"view":{"@id":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/?page=1","@type":"PartialCollectionView","first":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/?page=1","next":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/?page=2","last":"https:\/\/tle.ivanstanojevic.me\/api\/tle\/?page=728"}} adriano@MacBook-Pro-von-Adriano test %

ivanstan commented 7 months ago

I'm not sure how did you came to this conclusion, I've checked out API for this search term is is responding with HTTP 200

https://tle.ivanstanojevic.me/api/tle/?search=Zarya image

If you want to target specific satellite you can do it by the designator id: https://tle.ivanstanojevic.me/api/tle/25544

One possible reason could be HTTP throttling if you have created too many requests in the short time, we are forced to temporarily deny you access so our servers don't get overload.

AdrianoWeid commented 7 months ago

did you replicate it with python?