BacLibAPI

BacLibAPI by Marius Müller http://mariusmüller.de

See https://documenter.getpostman.com/view/8028167/SVSRG67r?version=latest for live (full working) version.

GET api
https://openballot.de/bac3/project/api/

Request without parameters. Returns error.



Example Request
api.php
curl --location --request GET "https://openballot.de/bac3/project/api.php"
Example Response
400 - Bad Request
Error 400 Topic not set. 
GET api basic with one topic
https://openballot.de/bac3/project/api/?topic=trump

Basic request with topic (required).

PARAMS

topic
trump

topic (required)



Example Request
api basic with one topic
curl --location --request GET "https://openballot.de/bac3/project/api/?topic=trump"
Example Response
200 - OK
{
  "result": {
    "count": 1,
    "sum": 2268,
    "mean": 2268,
    "median": "2268",
    "max": "2268",
    "senti": -617.051998999581,
    "senti_mean": -0.2720687826276812,
    "date_array": [
      "2019"
GET api full with one topics
https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31

Request with one topic and all other possible parameters.

PARAMS

topic
trump

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2018-01-01

start year (optional)

end
2019-12-31

end year (optional)



Example Request
api full with one topics
curl --location --request GET "https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31"
Example Response
200 - OK
{
  "result": {
    "count": 2,
    "sum": 4527,
    "mean": 2263.5,
    "median": 2263.5,
    "max": "2268",
    "senti": -1302.6277991867537,
    "senti_mean": -0.2877775963132148,
    "date_array": [
      "2018",
GET api full with multiple topics
https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=merkel&topic_c=usa

Request with multiple topics and all possible parameters.

PARAMS

topic
trump

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2018-01-01

start year (optional)

end
2019-12-31

end year (optional)

topic_b
merkel

second topic (optional)

topic_c
usa

third topic (optional)



Example Request
api full with multiple topics
curl --location --request GET "https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=merkel&topic_c=usa"
Example Response
200 - OK
{
  "result": {
    "count": 2,
    "sum": 9416,
    "mean": 4708,
    "median": 4708,
    "max": "4921",
    "senti": -2571.4008000883186,
    "senti_mean": -0.2740111068375977,
    "date_array": [
      "2018",
GET api full zero test
https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2000-01-01&end=2001-12-31&topic_b=merkel&topic_c=usa

Request with all possible parameters for year 2000-2001. For testing. Returns parameter and zero results.

PARAMS

topic
trump

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2000-01-01

start year (optional)

end
2001-12-31

end year (optional)

topic_b
merkel

second topic (optional)

topic_c
usa

third topic (optional)



Example Request
api full zero test
curl --location --request GET "https://openballot.de/bac3/project/api/?topic=trump&unit=Y&start=2000-01-01&end=2001-12-31&topic_b=merkel&topic_c=usa"
Example Response
200 - OK
{
  "result": {
    "count": 0,
    "sum": 0,
    "mean": 0,
    "median": 0,
    "max": "0",
    "senti": 0,
    "senti_mean": 0,
    "date_array": [
      "2000",
GET api mmde precision test
https://openballot.de/bac3/project/api/?topic=rp19&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=seligenstadt

Returns two posts from mariusmüller.de. Parameter are known, tested and have to fit 100% for all.

PARAMS

topic
rp19

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2018-01-01

start year (optional)

end
2019-12-31

end year (optional)

topic_b
seligenstadt

second topic (optional)



Example Request
api mmde precision test
curl --location --request GET "https://openballot.de/bac3/project/api/?topic=rp19&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=seligenstadt"
Example Response
200 - OK
{
  "result": {
    "count": 2,
    "sum": 2,
    "mean": 1,
    "median": 1,
    "max": "1",
    "senti": 0.3609999935142696,
    "senti_mean": 0.1804999967571348,
    "date_array": [
      "2018",
GET DRAFT api-draft.php
https://openballot.de/bac3/project/api/api-draft.php

Request without parameters. Returns error.



Example Request
DRAFT api-draft.php
curl --location --request GET "https://openballot.de/bac3/project/api-draft.php"
Example Response
400 - Bad Request
Error 400 Topic not set. 
GET DRAFT api-draft.php full with multiple topics
https://openballot.de/bac3/project/api/api-draft.php?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=merkel&topic_c=usa

Request with multiple topics and all possible parameters.

PARAMS

topic
trump

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2018-01-01

start year (optional)

end
2019-12-31

end year (optional)

topic_b
merkel

second topic (optional)

topic_c
usa

third topic (optional)



Example Request
DRAFT api-draft.php full with multiple topics
curl --location --request GET "https://openballot.de/bac3/project/api/api-draft.php?topic=trump&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=merkel&topic_c=usa"
GET DRAFT api-draft.php full zero test
https://openballot.de/bac3/project/api/api-draft.php?topic=trump&unit=Y&start=2000-01-01&end=2001-12-31&topic_b=merkel&topic_c=usa

Request with all possible parameters for year 2000-2001. For testing. Returns parameter and zero results.

PARAMS

topic
trump

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2000-01-01

start year (optional)

end
2001-12-31

end year (optional)

topic_b
merkel

second topic (optional)

topic_c
usa

third topic (optional)



Example Request
DRAFT api-draft.php full zero test
curl --location --request GET "https://openballot.de/bac3/project/api/api-draft.php?topic=trump&unit=Y&start=2000-01-01&end=2001-12-31&topic_b=merkel&topic_c=usa"
GET DRAFT api-draft.php mmde precision test
https://openballot.de/bac3/project/api/api-draft.php?topic=rp19&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=seligenstadt

Returns two posts from mariusmüller.de. Parameter are known, tested and have to fit 100% for all.

PARAMS

topic
rp19

topic: one word (required)

unit
Y

unit: D / M / Y / W (optional)

start
2018-01-01

start year (optional)

end
2019-12-31

end year (optional)

topic_b
seligenstadt

second topic (optional)



Example Request
DRAFT api-draft.php mmde precision test
curl --location --request GET "https://openballot.de/bac3/project/api/api-draft.php?topic=rp19&unit=Y&start=2018-01-01&end=2019-12-31&topic_b=seligenstadt"