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
10
votes
1answer
6k views

Simple yet Hackable WhatsApp API [UNOFFICIAL]

There is no official WhatsApp API. Here is a simple python class which satisfies the need. ...
1
vote
0answers
35 views

Return two results from API with an ID set

I am calling from an API to return a member and their upcoming classes. I would like to show only the next two classes (up to six are available in the API) that have an ID set. ...
2
votes
1answer
284 views

Beginner Node.js app using Heroku w/ Mailchimp API

I'd like some feedback on the readability and style of the following code. It's a simple Node.js app that uses the Mailchimp API to add emails to a list. The client side handles SVGs, sign-up ...
4
votes
1answer
530 views

Python API for simple OpenCV image proc, called with JSON inputs

Background I've got OpenCV & Python installed on a Docker container which is on a http server to process images and serve them. The user interface is through the web; user inputs an image and ...
2
votes
2answers
2k views

Java API token expiration handler

I want to implement a utility class which manages tokens generated by any API. The idea is simple: It should store the current token value. The token should be initialized just before first use ...
1
vote
1answer
77 views

Aggregating clients and client types

The code I have put together achieves what I want, but I don't know if it is the right way to go about tackling the problem. I am dealing with 2 tables (CLIENT, CLIENTTYPE) each of which I have an ...
6
votes
1answer
317 views

Python API for Crimson Hexagon

I'd like some feedback on the readability, style, and potential problems or issues. In particular I'm not too happy with how I handle ratelimits. ...
2
votes
1answer
63 views

Small module for getting JSON to work with in Python

I currently have a module with Class / Methods I want to use in other scripts. Recently chess.com released a read-only REST API for beta-testing. The methods in my class build a URL for the API ...
3
votes
1answer
102 views

API Implementation and Architecture

I recently put together an Express/Node API that consumes and transforms an additional third party API. And while everything is working great, I feel there may be ways to improve the architecture ...
1
vote
0answers
49 views

Android continually run api request

What is the best practice to run continually api request, like every 1-10 seconds. Currently I am doing this which is not a good practice I think, it probably causes some overhead: ...
3
votes
1answer
939 views

Bulk Email notifications in Java?

I have written a service which uses the Java Mail Api to send bulk email notifications to the recipients. I feel that the way I implemented the solution is not really scalable when the number of ...
1
vote
1answer
184 views

Fetching and shortening URLs with API calls using Promises

I have a node module that accesses the News API to fetch news articles and runs each article's URL through Google's URL shortener. It also has a caching mechanism implemented. This was previously ...
1
vote
0answers
37 views

API separate request vs logic

Is it a good practice to separate Logic from Request controller in an Api ? Without separation: ...
0
votes
1answer
481 views

C# API Wrapper with Static Function Calls

I'm creating a wrapper library for an API, and I hit a block on how to redesign it. The entire library is static, and I'd like to change it to make it more testable. The library's goal is to make ...
3
votes
2answers
547 views

Implementing unified API data flow in ASP.NET Core

I have the API project on ASP.NET Core, and it's quite annoying always write methods like this: ...
3
votes
1answer
278 views

Standard primitive types vs custom structs in public API

I am writing a .NET library and have a lot of properties like this: public ??? SomeProperty { get; set; } where valid values are 0-15 (or from 00000000 to ...
3
votes
1answer
399 views

Simple Imgur API

I slowly made an Imgur client and everything works but I have few questions about how to make classes more OOP and cleaner. Is that correct to make generateToken ...
5
votes
1answer
1k views

Rails & RSpec - Testing API with request specs and shared examples

I have written the following shared examples which are used in multiple request specs to test a namespaced RESTful JSON API. Application details: Rails 4.2, RSpec 3.5, Devise for authentication and ...
3
votes
1answer
767 views

JSON Cache Program

I have some code that is intended to be a package (so that it can be accessed via import cachejson). Here is the code for the package: The update variable is ...
3
votes
0answers
40 views

oEmbed provider servlet to handle four media types

I would like to add oEmbed tags to my site (I'm the oEmbed api provider). My api should respond the results based on the file type. oEmbed Types has Photo Video Link Rich My response to photo ...
0
votes
1answer
47 views

Displaying API results inside a WordPress page template

I've created a WordPress page template that calls an API using Httpful and formats the results. This is my first time using APIs on a page, so I'd like to know if this is the right direction to go in. ...
3
votes
1answer
313 views

Ruby wrapper for Instagram API

I've created my first gem as Instagram API wrapper https://github.com/agilie/instagram_api_gem. I would be very pleased if you give me some feedback on code organization, methods elegancy and so on. ...
1
vote
1answer
399 views

Populate DataTable with API results

I am querying an API and populating a C# Datatable with the results, then using a Table Value Parameter to populate a SQL Server table with the results. This is my solution, but it is slow and takes ...
4
votes
1answer
414 views

AntiCSRF: simple CSRF token management for server APIs

I've been working on a full stack web application for a school project, and I wrote antiCSRF without prior experience or example code to prevent Cross-Site Request Forgery attacks, and to ...
13
votes
2answers
2k views

Current ISS latitude / longitude position

I'm looking into basic API examples and I've got the following to work as I want it to. Is there a better way to determine the direction of latitude and longitude? It feels like I could do it better. ...
3
votes
1answer
113 views

A UNIX timestamp microservice

I have made a small timestamp microservice that converts from UNIX time to a natural language date, and vice versa. Please let me know of anything I could do better. Here is a demo. Here is the time....
2
votes
0answers
757 views

REST API wrapper class with Alamofire + Gloss

I have come up with this structure to handle API calls using Alamofire + Gloss. The multipart method I came up with was kind of in a hurry, it works but I think it could be done much better. So this ...
-1
votes
1answer
467 views

Getting deceptive/malware content sites list with Google Safe Browsing v4 [closed]

First of all I am not a programmer. I am starting small project to kill time. I am using Google Safe Browsing API v4 in PHP to get the deceptive sites which contain malware. I searched on Google and ...
1
vote
2answers
518 views

Manually mapping complex objects using Windows Service & Shopify

I'm looking for guidance/review on an approach that I've taken. Structure Windows Service Shopify Module (API) Official Shopify API The Scenario Our Windows Service connects to the Shopify Module ...
6
votes
1answer
1k views

Django Rest Framework Totaling API values in different ways

I am working on a stats website for my softball teams that I manage/play for. Here is my current Stat model: ...
2
votes
0answers
133 views

Send image between apps

I have an ASP.NET CORE API app and now I have an endpoint like: ...
3
votes
0answers
104 views

Load data from WebAPI to the ViewController

My current code working perfectly, it is for data load from web api to the UIViewController (UITableView). But I am confused ...
3
votes
1answer
982 views

Creating a generic filter system to pass into an API request

I am building an application that will interact with an API. My service layer will call the repository which will request data from the API. I want to be able to pass filters to the repository and ...
3
votes
1answer
66 views

Query database and check server details

I have written bash script to query database and check server details. Please let me know if the script is as per best standards: ...
1
vote
2answers
1k views

2Captcha API wrapper

So I've created an API wrapper for 2captcha in c# and I wonder what I can do do improve the code, make it cleaner? Code: ...
2
votes
1answer
236 views

A neighborhood map of things to do and eat in Downtown Las Vegas

I have been coding in javascript for almost a year now, and I would like your input on what I could do better. Also, any tips for organizing code a little better? Do you use MVC for every project? ...
3
votes
0answers
59 views

A function that debits a virtual wallet and calls an API to disburse to a real account

I am trying to determine if there is a better way to handle reversals for this function. This is how it works: A user inputs in amount, bank, and account number this would be used to debit his ...
6
votes
3answers
2k views

REST API to list books, where null means “everything”

My company has a REST API, and one design issue that has come up a few times is that we use null to indicate "get everything". For example /api/books?genre=romance ...
2
votes
1answer
67 views

Get application credentials from linked array obtained from Cloud Foundry API

I am new to Java and I use the following code to retrieve parameters from a linked hash map from the Cloud Foundry API. My question is if there is a better way to do it in Java? ...
2
votes
2answers
213 views

TranslateIt class using the Yandex translation service

I wrote a class TranslateIt for translating text files with Yandex.Translate service. I feel the code is rather bulky. Is it ...
5
votes
1answer
5k views

Currency Converter in Python 3

Beginner Python developer here. I was tinkering around with Python and decided to build a currency converter. It takes in input from the user and prints out the converted currency values. The fixer.io ...
0
votes
1answer
657 views

How to optimize the Flask RestFul api

The tutorial is here I want to build a RestFul API with Flask to query User Agent data. Curl script shows below. The api should work with three or two or one or even zero argument. So how to change ...
4
votes
1answer
42 views

Ruby Twitter Search by punctuations

With twitter search the punctuation and special characters will be considered part of the term you're searching for, so searching for '#twitter!' will return '#twitter!', "twitter?', '#twitter', etc. ...
2
votes
0answers
100 views

Fetch object from database, or fetch it using an API if it isn't there

To give some background on this particular code, there is a controller which recieves an object, hashes parts of it and looks into a database to see if there is a similar hash in the db, if there is, ...
6
votes
2answers
543 views

Simple Graph in Python

Just the beginning of graphs API in Python: ...
4
votes
0answers
45 views

Texplode KotH controller

I am creating a KotH (King of the Hill) challenge for Programming Puzzles and Code Golf. Other site users will write programs that play Texplode (a version of this game on a square grid). The program ...
4
votes
1answer
148 views

pyvdp - Python library for Visa Developer Program

I'm coming from PHP and recently started developing in Python. As a part of my self-study course, I developed a small library for access to Visa Developer Program APIs and published it on Github. It ...
1
vote
0answers
66 views

ES6 template literal tag function and polyfil fetch

The goal of this is to create an easy to use front-end interface to work with graphql APIs. Can anyone tell me if there are any inefficiencies or areas of ...
2
votes
1answer
439 views

Slack App OAuth flow in golang

I'm working on a Slack app that uses Slash Commands. I've been looking for an excuse to learn Go, but the online tour was a little slow paced so I tried jumping in with this project. I'm looking for ...
6
votes
1answer
2k views

Java 8 spliterator for paged results

Summary: I am using an API which returns paged results. I want to have these results as Java 8 Stream and implemented a ...