Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [api]

API, for code implementing (not using) an Application Programming Interface. A program's API defines the proper way for a developer to request services from that program, site and/or service.

Filter by
Sorted by
Tagged with
1
vote
0answers
32 views

Password Checker using Pwnedpasswords API in Rust

This takes a user password, hashes password to SHA1 and does a check against the Pwnedpasswords database. I know I need to use unwrap less and do more real checking to improve the clarity of errors. ...
-1
votes
1answer
99 views

Read JSON files, basic calculations and write over another JSON file

Class SectorController calculates weight coefficients for sector performances in equity exchange markets using minute data from an API (for instance, if a group of ...
0
votes
0answers
251 views

Gmail API list messages NodeJS

I use the following code to list and trash messages from the Gmail API in NodeJS. I call the getAllMessages method to get all email bodies because the Gmail API ...
4
votes
1answer
175 views

Google Custom Search placeholder function in JavaScript

Problem: We have a Google Custom Search function that replaces the input placeholder attribute and it works okay. Would you be so kind and help me with reviewing ...
4
votes
2answers
191 views

PHP script that writes a JSON file with iextrading API data

iextrading has two APIs (v1, v2) which provide financial market data. Following script records a JSON file with their equity information (using a CRON job). Would you be kind and review it for any ...
3
votes
2answers
99 views

Use weather API to get information in JavaScript + jQuery

Please can any code experts review and improve my code? HTML ...
-1
votes
1answer
56 views

C++ API design - Should I pass enums as method parameters [closed]

I have two methods which are GetMinimumSize() and GetMaximumSize(). They return the maximum size of the window, and they take ...
2
votes
1answer
45 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 ...
2
votes
0answers
133 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 ...
4
votes
1answer
103 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 ...
1
vote
1answer
83 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 ...
5
votes
1answer
88 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. ...
11
votes
1answer
152 views

Writing PDF files in C#

I have been making C# software to write PDF files. It's intended to be simple to use, compact, efficient and also reasonably simple to understand, maintain and extend as required. The basic ...
4
votes
2answers
89 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, ...
4
votes
0answers
76 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 ...
1
vote
0answers
47 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 ...
2
votes
1answer
249 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
418 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 ...
9
votes
1answer
134 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
110 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
136 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
73 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
188 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 ...
2
votes
0answers
54 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
1answer
44 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 ...
0
votes
1answer
60 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
89 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. ...
0
votes
1answer
63 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 ...
3
votes
1answer
81 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
113 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 ...
2
votes
1answer
3k 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 ...
6
votes
1answer
76 views

Filter by multiple options - also only if not empty [closed]

Here's how my json looks like. I'm trying to write a function which filters based on participantCriteria.criteriaType & participantCriteria._id ...
0
votes
1answer
1k 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
82 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
100 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
206 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
243 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
181 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 ...
9
votes
1answer
928 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
1k 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
1answer
288 views

Executing a sequence of actions over time in Unity

This script executes a sequence of actions over time and is based on the methods exposed by the UrhoSharp framework. I am new to Unity, but well acquainted with C# so I know what I'm doing for the ...
3
votes
3answers
67 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
177 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: ...
4
votes
1answer
60 views

Code improvements for React App

This was my code challenge for a Junior JavaScript Developer position. The app is mostly running error-free, but I was rejected for the role, so I assume there were major issues with my code and have ...
1
vote
1answer
96 views

Kotlin API - endpoint for users

I am writing API in Kotlin - this is my first code in this language. I implemented a very primitive 'player' endpoint. I was wondering if I am doing everything ok (please don't mind the static ...
2
votes
0answers
202 views

Setting many properties in a PHP class

I'm trying to define parameters for my API. It's a super basic one and the first I've made. I'm trying to instantiate my class and set parameters but to me it seems super messy. Is this really the ...
1
vote
3answers
105 views

Calculate cryptocurrency gains and losses using the Coinbase API

This class calculates the gains and losses (in USD) from the four leading cryptocurrencies using the Coinbase API. (The full repo can be found here) In addition to general feedback there are some ...
3
votes
1answer
232 views

Code to call Space X API and display results

This is a technical test from a job interview. The feedback was that although it does as asked, the application structure wasn't great. As a beginner I'm not entirely sure what's wrong with it and ...
3
votes
1answer
84 views

API Gateway for blocking api calls

I recently had a programming interview, where I had to create an Api Gateway. The description is as follows: You need to create a gateway in which it only allows certain number of callers to call ...
0
votes
0answers
57 views

Looking for react API call and es6 map() evaluation

The react application is showing API fetch result in the page based on query string tag selected. There are few question in ...