Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [api]

API stands for Application Programming Interface. A program's API defines the proper way for a developer to request services from that program.

1
vote
0answers
23 views

See if a specific resource exists in a Kubernetes namespace

I want to have a function that checks to see if a certain resource (deployment, job, cronjob etc) exist in a namespace. Using the Kubernetes Python client, I can create a boolean function (using ...
2
votes
1answer
24 views

RESTful API echo server using Python bottles

I just wrote an echo server that responds to curl requests with the method used and the data sent. Sticking to GET and POST for now, but I would like to know if there's something I can do to improve ...
1
vote
0answers
34 views

PHP project with Google Calendar API

I'm playing with a simple (for now) project in PHP with Google Calendar API. I have posted the code here in order to improve my programming style about whatever you think it's worth suggesting. Thank ...
5
votes
0answers
37 views

Finding unimplemented tasks on Rosetta Code using Requests

This is a Find unimplemented tasks task from Rosetta Code: Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language. There is already a solution ...
4
votes
1answer
37 views

DigitalOcean dynamic DNS update script

Inspired by a shell script I saw on Github, I put together a Python version to update the dynamic IP address for a subdomain I have that uses DigitalOcean's nameservers. I added a check to see if the ...
0
votes
1answer
48 views

Laravel show and update currency from rest api

I need: Daily save new exchange rates from the REST API in the database. Return the current exchange rate for a given currency, the whole table for a given day, the exchange rate for a given currency ...
1
vote
0answers
20 views

API Client: Querying data out of an endpoint

I have a simple piece of code which connects to an API, does a request and gets back the raw data. After getting this data I create several objects (models) and persist them into a MongoDB database. ...
5
votes
1answer
44 views

NHL Stats web app

There is a web app. My first attempt to use NHL API have been reviewed here. I'm interested in any kind of refactoring of this code. But I have some questions that I want to point at specifically. ...
1
vote
0answers
67 views

A D wrapper around C library librdf (code) [closed]

I have created a D wrapper (static and dynamic library) around the C library librdf. The version for review: https://github.com/vporton/redland-bindings/tree/5d942dab18eeb66508fdffeb328bd190a3cd9c41/...
4
votes
2answers
77 views

GitHub repo tree generator

I have built a generator that, using the GitHub API, creates a dictionary containing a tree of all the resources in any GitHub repo. It uses the function git_tree, ...
3
votes
0answers
50 views

One interface for multiple CRUD resources

I asked about an abstraction layer for accessing files (link) a couple of days ago (I decided to not call it a follow-up anymore as there are too many changes). I tried to incorporate many of the ...
6
votes
1answer
55 views

Spotify current track to vk.com user's status

This is refactored and much more expanded version of the script reviewed here. The whole authorization process is added. ...
3
votes
1answer
53 views

Use Python along with the HubSpot HubDB API and the Blog Post API to create, update, and publish a batch of blog posts

My program automates the process of creating and publishing 152 blog posts quarterly. The blogging platform HubSpot has a series of APIs that allow developers to access account data from a CLI in ...
2
votes
1answer
64 views

Spotify API data to vk.com user's status

Just a simple script that puts a user's currently playing track(on Spotify) to his account's status on vk.com. And printing info about the track in the console. ...
1
vote
0answers
33 views

TDD for Ruby On Rails API for group event items

I found myself working in this coding exercise for a work offer. I tried to apply TDD in the process but I didn't get any feedback from the company and I really would like to know what can be improved ...
7
votes
2answers
229 views

Translating LaTeX documents into different languages using DeepL API

I'm coming from C and C++ and have often troubles using Python's full potential. This is a script I wrote to translate LaTeX documents into different languages. A parser replaces all latex specific ...
3
votes
1answer
52 views

Command-line NHL skaters stats tool

Have been playing with the undocumented NHL API for some days. I'd love to see any input about this little script. About overall structure, style, performance enhancements, etc. Not sure how to ...
2
votes
1answer
25 views

Offset vs Cursor Pagination

I am trying to compare any performance gain(s) from moving a current offset-based pagination endpoint to a cursor based one. I have the following ruby code: ...
3
votes
0answers
94 views

Python script for OpenStack health check

First time moving from Bash to Python for scripting and looking for feedback/improvements. I've spent the weekend learning about OOP, and am aware that not fully utilizing it in this script — so any ...
6
votes
0answers
95 views

Flight API querier

I am learning Go and wrote a small application that queries the Skyscanner API as my first attempt at learning. I was hoping someone more expert than me in the language could look over it at broad ...
0
votes
2answers
86 views

Web scraping and speeding up performance

I was wondering if the following code could be altered to speed up the scraping process. I know xrp has many transactions, but it takes an hour to go through half a day of transactions (at the busiest ...
1
vote
1answer
119 views

WeatherApp, working with APIs

I'm making a WeatherApp. It uses the browser's location to get the GPS coordinates, then sends those to an API to get details about the location (e.g. city, country, etc.). The city is then sent to a ...
2
votes
1answer
67 views

Rails thin controller method to change account plan and fire slack message via a service object

I'm a beginner with Rails and am trying to figure out how to keep my controllers clean and thin, and how to work with service objects. I am building an internal tool to manage our SaaS customers, and ...
2
votes
0answers
90 views

Wrapping a web scraper in a RESTful API

The problem I am looking to solve is wrapping a web scraper in a RESTful API such that it can be called programmatically from another application, frontend or microservice. The overall goal is that ...
4
votes
1answer
56 views

Simple API call to get geo info and exception handling with call limiting to 50 request per hour in Python

I'm looking for a code review of this python I wrote - this code reads the zipcode column value from csv and calls the api and brings back lat, lng, state and city info. It works fine and gives me ...
2
votes
0answers
48 views

Best approach to parse data from multiple APIs to Entities in PHP

I built an application that extracts and updates data from multiple ecommerces websites. Each eCommerce is either built using platforms/frameworks such as Shopify, Prestashop or WooCommerce. This ...
0
votes
0answers
32 views

Flask models for scores and statistics

I'm not sure whether I need to group a bunch of related methods in a single class or put them in a separate module. Which way would be preferable in Python? Here is what I've got so far but not sure ...
0
votes
1answer
30 views

Pyramid of doom Grape endpoints

I'm creating an API endpoint to create and delete associations, essential creating and deleting records of a join model. The code below doesn't seem idiomatic or pragmatic at all. What's the best way ...
7
votes
2answers
165 views

Getting current weather data using OpenWeatherMap API

I would really appreciate if someone could take a look at this code. I am not very advanced, so ANY kind of feedback and critique would be precious to me. What this program is supposed to do is to go ...
-1
votes
1answer
48 views

Building a 64 × 64 particle accelerator frame in Minecraft with a computercraft turtle

I dont think this will work anywhere besides in minecraft with computercraft but it's all correct syntax. I just feel like it has some lines of code I could eliminated somehow and made it a cleaner ...
1
vote
1answer
68 views

Wrapper for a sales API, with a fluent interface

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
5
votes
2answers
2k views

Star Wars API GET request in Python

I am working with a Star Wars API from http://swapi.co/api/. Here's the problem that I was working on for the Star Wars API problem. And the code works and prints out the exact output that I desired. ...
-1
votes
1answer
51 views

Nodejs Interview - API calls and exchange rate

I did an initial technical phone screening with this company which went ok, they then sent me a programming exercise to complete and send back to them. The goal of the exercise: -take input as a ...
4
votes
1answer
43 views

Python program that gets basic information on a Github user

I've created a basic Python CLI script, which takes a Github username, and returns some basic information associated with said username. I use the requests for HTTP requests (I'm new to this area) and ...
3
votes
1answer
59 views

Java Concurrent Recursive API Access

I don't get to write multithreaded applications very often, so be gentle with my threads :-) I have an API input which contains a "score" and then a bunch of child nodes which also have scores, and ...
3
votes
1answer
106 views

Java Messenger data transmission

This is a very simple concern, could somebody take a look at a few lines of my code? I'm writing a simple Java multi-user messenger, it is structured in a desktop client with a Swing GUI, a java ...
1
vote
1answer
551 views

Async await multiple API calls

I have an application that needs to contact a remote API many times to request information about various products. It was taking around a minute with synchronous programming. I adjusted all my methods ...
4
votes
1answer
59 views

Filter by multiple options - also only if not empty

Here's how my json looks like. I'm trying to write a function which filters based on participantCriteria.criteriaType & participantCriteria._id ...
0
votes
0answers
41 views

Asynchronous API handler function to update a game

I think mainly the GameController can use some optimization Game Entity.ts ...
0
votes
1answer
399 views

Toy Robot coding puzzle with Java

The following code is my solution to a code challenge I submitted a few days ago. I got rejected straight away with no feedback and I've wondered why. Here is the full code repo. Requirements ...
3
votes
0answers
42 views

Python API article/image client using requests, pypandoc and os editor

My first (real?) program. The client connects to a Django restframework API by sending user credentials to obtain a token for headers. Then the user can drag and drop an image from a os folder into ...
3
votes
0answers
78 views

Implementing secure API for use between other internal apps

My team and I are trying to implement a secure API and would appreciate some feedback on the following: If there are areas of improvement in the current code to improve security Recommendations on ...
3
votes
0answers
91 views

Retrieving data from the movie database

I am trying to retrieve the series, seasons and episodes from the movie database, however I am pretty new to Ruby on rails and I feel like what I am doing could be improved a lot. I use an ...
2
votes
3answers
118 views

Display search results for TV shows

I haven't been coding super long in this language so if someone could take a look and help me improve my code and make it more efficient, that would be great! The HTML is one input field that you can ...
1
vote
2answers
170 views

Retrieve data from eBird API and create multi-level hierarchy of locations

As you may know, I like birds. The Cornell Lab of Ornithology has a tool called eBird where you can submit records of the birds you identified. I recently learned they have an API that I can query, ...
3
votes
1answer
112 views

Enforce request completion order using Multiple Promise Chaining

The main entry point is the SyncmyCompany() function. I have a interesting scenario where I'm syncing data from a Company to a destination system. In this case ...
8
votes
1answer
580 views

Simple cryptocurrency portfolio rebalancer

EDIT: the code has been changed significantly since the OP based on the first posted answer and some refactoring. Feedback on the general design of the app itself is still more than welcome. The ...
5
votes
2answers
667 views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
3
votes
3answers
57 views

REST API for random number generation using Falcon

I have written REST API for random number generation using Falcon(https://falconframework.org/), just for my learning process. This is API: ...
5
votes
1answer
127 views

Wikipedia Random Page in Category Bot

I recently wrote a Python script to generate a random page within a Wikipedia category and its subcategories: ...