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.

Filter by
Sorted by
Tagged with
3
votes
1answer
26 views

Get list of new questions from Stack Overflow

I would like to write a little pet project using Clojure to study it, something like Stack Overflow client. Here is a my first code to get list of new questions from site. I am in the very beginning ...
1
vote
0answers
24 views

test oriented design; Python test script to test a company's API, print test results, log exceptions

I'd like some constructive feedback on the code that I have written to test the API for smartsh33t.com I wrote it in Python. I wrote the program to take .json files and read them into the testrunner....
2
votes
1answer
57 views

JSON Parser, pulls data from a JSON file for analysis

This is the first time I have programmed something that I will actually personally use, so I am happy about that. I tried to write good code whilst applying functional programming concepts. So no ...
3
votes
0answers
32 views

PayPal Checkout API with PHP - Sending and retrieving additional data safely

I am learning to use the new API version of Paypal, and I have some doubts. Note: I've tried this on https://www.sandbox.paypal.com and it works, I have not done the tests on Live. onApprove: I ...
4
votes
2answers
66 views

Music Theory: The Basics - a Ring

I've recently started building an API that allows a consumer to create and manipulate musical entities such as notes, intervals, scales and chords. The first step is to create a a foundation of base ...
3
votes
0answers
50 views

Rest API in a trimmed model

I practiced my Java knowledge in the last couple of days. For that, I want to create a Rest API in a trimmed scale, because there a lot of aspects which must be considered in such an API (Login, ...
4
votes
1answer
100 views

Pulling data from the GitHub API for user repositories

I'm looking for specific feedback on a major design change that I plan on making to my personal website (https://aleksandrhovhannisyan.github.io/). Currently, the Projects section contains hardcoded ...
0
votes
0answers
19 views

c# Httpclient singleton with different authentication header [migrated]

I have an azure function that calls API and I made my HttpClient as a singleton in the startup Dependency Injection so I can call it on my contractor. ...
2
votes
0answers
76 views

Google drive backup robot

I have a lot of files. I care about those files. I also care about good programming practices and learning proper python. Given the described context, it seemed appropriate to implement my own ...
3
votes
1answer
53 views

Asynchronous hardware communication - Library Design

I've got some equipment ("tool") that communicates over CANbus that I need to communicate with. I'm using a USB->CAN dongle that provides a basic .Net control library. I'm in the process of writing ...
0
votes
0answers
13 views

Axios Resource Level Rate Limiter with Priority

I'm using multiple APIs with different rate limits and also do requests to non-rate-limited websites and I didn't want to handle multiple axios instances for each type. There are quite a few limiters ...
3
votes
1answer
50 views

Haskell API for manipulating Tree/Forest

I'm experimenting how a Relation (a cartesian product's subset) can be implemented in Haskell using different data classes. Forest and Tree allow to keeps together in a single data structure ...
7
votes
1answer
140 views

Build a set of REST interfaces using Symfony framework

I have got a technical challenge from a company but they reject my code and I'm not sure how to do this challenge in a more efficient way so I'm here to get some guidance. The Technical challenge was:...
5
votes
2answers
95 views

HttpClient reusable instance for simple calls on another methods

I wrote a HttpClient instantiable class that will be used as reference to simplify API calls in other methods inside other classes, so the user could call it in a ...
1
vote
0answers
16 views

Response structure with populated fields

I am working on a backend for an application using a microservice framework with Sequelize and it is populating in the following way (it does based on the table field): ...
4
votes
0answers
30 views

Asynchronous Stripe API and aiohttp parameters formatting

I'm testing the Stripe payment API. I couldn't find a Python wrapper that provides asynchronous requests so I'm writing one. My first goal was to implement the async equivalent of ...
2
votes
1answer
46 views

API endpoint that returns phone numbers

Background An API endpoint that returns phone numbers. I would appreciate some feedback on this very simple service class that is part of the overall solution. Here is its Interface: ...
6
votes
2answers
288 views

Speeding up Excel distance calculation using Bing API calls

I am writing VBA in Excel to calculate the distance between an employee's home address and work address using Bing Maps API calls. The process follows this general flow: 1) Convert the employee's ...
10
votes
3answers
646 views

General purpose replacement for enum with FlagsAttribute

Enums with the FlagsAttribute have the disadvantage that you need to be careful when assigning their values. They are also inconvenient when you would like to allow ...
3
votes
1answer
79 views

API for multiple printer attributes [closed]

I have network printers which have different attributes (e.g. supported network protocols, languages, status, print modes). ...
7
votes
2answers
170 views

Snake Game with own Field API

Some days ago, I posted a question here: Field class as basis for a role playing game I payed respect to tips I find useful and made a further development of my Field-classes. These classes have to ...
1
vote
1answer
75 views

Script to get available IP automatically

Recently I made a script to get available IP automatically. I was woundering if anyone can give me tips on how to make this code look better, preferably in a class and OOP. I'm gonna show the code to ...
2
votes
0answers
23 views

WordPress rest api basic auth with IP check

I'd like to use basic auth with the WordPress API, but restrict the capability to a single IP address. I've updated the existing code from here: https://github.com/WP-API/Basic-Auth accordingly. It ...
3
votes
0answers
62 views

User registration in Actix w/ DynamoDB

I am trying to puzzle out api based user registration for a service I am building, but I have a strong feeling that my code is not optimal. It feels like passing "state" in the way I did prevents the ...
1
vote
0answers
32 views

Temporarily block API calls when server sends a 503 response

I have a scenario in which I call many APIs throughout my application lifecycle. In case the server sends me a 503 response code, it will also send a lockdown object which has a timestamp associated ...
7
votes
1answer
52 views

ArXiV Technical Paper API Github Repo

My name is Ethan and I am trying to build an API for scaping technical papers to use for developers. Right now it only works for ArXiV but I would greatly appreciate some mentoring or a code review of ...
1
vote
0answers
18 views

Requests / Facebook API - Dealing with Errors

I work in marketing and I am currently trying to aggregate data for 50 facebook pages on the same Business Page. I have a loop ...
5
votes
1answer
56 views

C++ API for reading RIFF files

I wrote a simple library for reading RIFF-encoded files in C++. I tried to adhere to modern practices and provide an idiomatic API, but there is one part that sticks like a sore thumb to me: the way ...
5
votes
2answers
97 views

Avoiding code repeating in RESTful APIS PHP

Since my last question related to this I have managed to create a working base and to understand how MVC works. I'm writing RESTful APIS in PHP, they serve the purpose but I see that my code is ...
1
vote
0answers
71 views

Implement versioning of a RESTful API with PHP/Slim and Apache

I want to create a RESTful API with Apache/PHP and the Slim Framework (3.x). The API should support URI-based versioning like ...
12
votes
1answer
678 views

Script to load the ISS location and data

I wrote a script to fetch the location for the ISS using two simple API's. This is my first time writing a python script. Any advice or modifications would be highly appreciated. How is the code ...
1
vote
0answers
31 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
87 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
125 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 ...
3
votes
1answer
111 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 ...
3
votes
2answers
149 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
85 views

Use weather API to get information in JavaScript + jQuery

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

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

I have two methods which are GetMinimumSize() and GetMaximumSize(). They return the maximum size of the window, and they take ...
1
vote
0answers
104 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
38 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
96 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
55 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
74 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
80 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
23 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
68 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. ...
5
votes
2answers
148 views

CloudFlare Dynamic DNS Update Script in Python 3

I have a computer that roams, but needs to have an FQDN attached to it for certain reasons such as email system integrations or testing email via a testing SMTP server that requires valid FQDNs and ...
4
votes
2answers
85 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
65 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
83 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. ...