Jump to content
Game-Labs Forum

Public "API" for Naval Action


Recommended Posts

  • 5 months later...

I'm just getting my server back on line after being down for months.  I'm noticing no DLC ships, and the battle ratings are way off.  Is this something new?

--thanks

lol -- wrong API file .... argh

Edited by RyebreadMike
Link to comment
Share on other sites

  • 2 months later...

Can anyone explain to me, how the following data can be retrieved from the API?

Mast HP, Mast Thickness, Armor Thickness, Rudder Half Turn Time

Is the formula SPEED = SpdToWind * MaxSpeed / 13.03 still correct?

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hello!
I want to automatically draw up the optimal route for carrying out trade missions with the delivery of passengers and goods, but I do not find this information in the 4 database files listed on the first page of the topic.
Where to get this information?

Link to comment
Share on other sites

  • 5 weeks later...
  • 2 months later...
On 9/6/2019 at 4:09 PM, Shane_Martin said:

Where would I go getting started with all this?

For example, database, connections ect.

Sample bash script to download all current API data and convert them to valid json files

#!/usr/bin/env bash

server_base_name="cleanopenworldprod"
source_base_url="http://storage.googleapis.com/nacleanopenworldprodshards/"
server_names=(eu1 eu2)
api_vars=(ItemTemplates Nations Ports Shops)

server_maintenance_hour=10
if [ "$(date -u '+%H')" -lt "${server_maintenance_hour}" ]; then
    server_date=$(date -u '+%Y-%m-%d' --date "- 1 day")
else
    server_date=$(date -u '+%Y-%m-%d')
fi

for server_name in "${server_names[@]}"; do
    for api_var in "${api_vars[@]}"; do
        url="${source_base_url}${api_var}_${server_base_name}${server_name}.json"
        out_file="${server_name}-${api_var}-${server_date}.json"

        curl --output "${out_file}" "${url}"
        sed -i -e "s/^var $api_var = //; s/\\;$//" "${out_file}"
    done
done

 

Link to comment
Share on other sites

On 8/6/2019 at 9:25 PM, ded said:

Hello!
I want to automatically draw up the optimal route for carrying out trade missions with the delivery of passengers and goods, but I do not find this information in the 4 database files listed on the first page of the topic.
Where to get this information?

Shop prices are available only for contracted goods

Link to comment
Share on other sites

  • 2 weeks later...

How to calculate sell price for consumed item in port?

In-game example:

Item#1861: Alligator hides, 

Port "Ays" (produced Alligator hides), sell price = 4715 (like as BasePrice field in ItemsTemplate)

Port "West End" (consumed Alligator hides), sell price = 5840

Distance from Ays to West End = 67k

 

Question: How to calculate sell price in consumed port, when we know BasePrice and Distance from produced port?

 

ItemTemplate json for item#1861 (Alligator hides): https://pastebin.com/embed_iframe/3mR1STD1

Shop json for shop#4 (West End)https://pastebin.com/embed_iframe/7TLKgcNJ

Shop json for shop#321 (Ays)https://pastebin.com/embed_iframe/aCvcN8aW

 

@admin can you help me?

Edited by DanseMacabre
add json examples from Naval Action public API
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 8 months later...

I'm trying to fetch this data using Angular 9. typescript.

 

This is my service, but it simply doesn't work, does somebody have a clue what I'm doing wrong?

 

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class NationsService {

  constructor(private http: HttpClient) { }

  getData() {
    const url = 'http://storage.googleapis.com/nacleanopenworldprodshards/Nations_cleanopenworldprodeu1.json';
    this.http.jsonp(url, 'callback').subscribe(response => console.log(response));
  }


}

 

Link to comment
Share on other sites

On 11/25/2019 at 7:11 PM, DanseMacabre said:

sell price for consumed item in port?

 

On 12/5/2019 at 10:40 PM, Marlinspike said:

bump, hoping for an answer.

The estimated sell price for a consumed good is

buyPrice * 3 + (planarDistance * buyPrice * distanceFactor) / 6 / 100
  • buyPrice: BasePrice from API data
  • planarDistance: distance between sell port and closest port dropping this good
  • distanceFactor: RangePct from API data

But fear not, my map calculates it all. Just use 'Select trade relations' and click a port. Estimated net profits are indicated at the bottom of the port info.

Link to comment
Share on other sites

 Share

×
×
  • Create New...